Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65041 - in branches/release/boost/interprocess: . allocators/detail containers/container containers/container/detail detail ipc mem_algo mem_algo/detail smart_ptr streams sync sync/emulation sync/posix sync/xsi
From: igaztanaga_at_[hidden]
Date: 2010-08-26 17:49:09


Author: igaztanaga
Date: 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
New Revision: 65041
URL: http://svn.boost.org/trac/boost/changeset/65041

Log:
Fixes for Boost 1.45
Added:
   branches/release/boost/interprocess/containers/container/detail/stored_ref.hpp
      - copied unchanged from r65008, /trunk/boost/interprocess/containers/container/detail/stored_ref.hpp
   branches/release/boost/interprocess/detail/robust_emulation.hpp
      - copied unchanged from r65008, /trunk/boost/interprocess/detail/robust_emulation.hpp
   branches/release/boost/interprocess/permissions.hpp
      - copied unchanged from r65008, /trunk/boost/interprocess/permissions.hpp
   branches/release/boost/interprocess/sync/emulation/mutex.hpp
      - copied unchanged from r65008, /trunk/boost/interprocess/sync/emulation/mutex.hpp
   branches/release/boost/interprocess/sync/emulation/recursive_mutex.hpp
      - copied unchanged from r65008, /trunk/boost/interprocess/sync/emulation/recursive_mutex.hpp
Removed:
   branches/release/boost/interprocess/sync/emulation/interprocess_mutex.hpp
   branches/release/boost/interprocess/sync/emulation/interprocess_recursive_mutex.hpp
Properties modified:
   branches/release/boost/interprocess/ (props changed)
Text files modified:
   branches/release/boost/interprocess/allocators/detail/adaptive_node_pool.hpp | 2
   branches/release/boost/interprocess/allocators/detail/allocator_common.hpp | 17
   branches/release/boost/interprocess/containers/container/deque.hpp | 141 +--
   branches/release/boost/interprocess/containers/container/detail/adaptive_node_pool_impl.hpp | 81 +-
   branches/release/boost/interprocess/containers/container/detail/advanced_insert_int.hpp | 77 +-
   branches/release/boost/interprocess/containers/container/detail/algorithms.hpp | 14
   branches/release/boost/interprocess/containers/container/detail/allocation_type.hpp | 6
   branches/release/boost/interprocess/containers/container/detail/config_begin.hpp | 98 +++
   branches/release/boost/interprocess/containers/container/detail/destroyers.hpp | 10
   branches/release/boost/interprocess/containers/container/detail/flat_tree.hpp | 158 ++--
   branches/release/boost/interprocess/containers/container/detail/iterators.hpp | 69 ++
   branches/release/boost/interprocess/containers/container/detail/multiallocation_chain.hpp | 36
   branches/release/boost/interprocess/containers/container/detail/node_alloc_holder.hpp | 56
   branches/release/boost/interprocess/containers/container/detail/node_pool_impl.hpp | 32
   branches/release/boost/interprocess/containers/container/detail/pair.hpp | 73 +
   branches/release/boost/interprocess/containers/container/detail/pool_common.hpp | 4
   branches/release/boost/interprocess/containers/container/detail/preprocessor.hpp | 60 +
   branches/release/boost/interprocess/containers/container/detail/transform_iterator.hpp | 10
   branches/release/boost/interprocess/containers/container/detail/tree.hpp | 99 +--
   branches/release/boost/interprocess/containers/container/detail/type_traits.hpp | 4
   branches/release/boost/interprocess/containers/container/detail/utilities.hpp | 47 +
   branches/release/boost/interprocess/containers/container/detail/value_init.hpp | 6
   branches/release/boost/interprocess/containers/container/detail/variadic_templates_tools.hpp | 8
   branches/release/boost/interprocess/containers/container/detail/version_type.hpp | 6
   branches/release/boost/interprocess/containers/container/detail/workaround.hpp | 8
   branches/release/boost/interprocess/containers/container/flat_map.hpp | 168 +++--
   branches/release/boost/interprocess/containers/container/flat_set.hpp | 78 +-
   branches/release/boost/interprocess/containers/container/list.hpp | 97 +--
   branches/release/boost/interprocess/containers/container/map.hpp | 104 +-
   branches/release/boost/interprocess/containers/container/set.hpp | 114 +--
   branches/release/boost/interprocess/containers/container/slist.hpp | 96 +--
   branches/release/boost/interprocess/containers/container/stable_vector.hpp | 56
   branches/release/boost/interprocess/containers/container/string.hpp | 93 +-
   branches/release/boost/interprocess/containers/container/vector.hpp | 145 +--
   branches/release/boost/interprocess/creation_tags.hpp | 4
   branches/release/boost/interprocess/detail/atomic.hpp | 2
   branches/release/boost/interprocess/detail/file_wrapper.hpp | 19
   branches/release/boost/interprocess/detail/intermodule_singleton.hpp | 1215 ++++++++++++++++++++++++++++++++++++---
   branches/release/boost/interprocess/detail/intersegment_ptr.hpp | 26
   branches/release/boost/interprocess/detail/managed_memory_impl.hpp | 17
   branches/release/boost/interprocess/detail/managed_multi_shared_memory.hpp | 37
   branches/release/boost/interprocess/detail/managed_open_or_create_impl.hpp | 40
   branches/release/boost/interprocess/detail/move.hpp | 538 ++++++++++++-----
   branches/release/boost/interprocess/detail/named_proxy.hpp | 5
   branches/release/boost/interprocess/detail/os_file_functions.hpp | 143 ++++
   branches/release/boost/interprocess/detail/os_thread_functions.hpp | 30
   branches/release/boost/interprocess/detail/posix_time_types_wrk.hpp | 3
   branches/release/boost/interprocess/detail/preprocessor.hpp | 52 +
   branches/release/boost/interprocess/detail/segment_manager_helper.hpp | 6
   branches/release/boost/interprocess/detail/tmp_dir_helpers.hpp | 48
   branches/release/boost/interprocess/detail/transform_iterator.hpp | 21
   branches/release/boost/interprocess/detail/win32_api.hpp | 661 +++++++++++++++++++++
   branches/release/boost/interprocess/detail/workaround.hpp | 9
   branches/release/boost/interprocess/detail/xsi_shared_memory_device.hpp | 6
   branches/release/boost/interprocess/exceptions.hpp | 23
   branches/release/boost/interprocess/interprocess_fwd.hpp | 6
   branches/release/boost/interprocess/ipc/message_queue.hpp | 27
   branches/release/boost/interprocess/managed_external_buffer.hpp | 10
   branches/release/boost/interprocess/managed_heap_memory.hpp | 2
   branches/release/boost/interprocess/managed_mapped_file.hpp | 13
   branches/release/boost/interprocess/managed_shared_memory.hpp | 15
   branches/release/boost/interprocess/managed_windows_shared_memory.hpp | 10
   branches/release/boost/interprocess/mapped_region.hpp | 57
   branches/release/boost/interprocess/mem_algo/detail/mem_algo_common.hpp | 21
   branches/release/boost/interprocess/mem_algo/detail/multi_simple_seq_fit_impl.hpp | 28
   branches/release/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp | 30
   branches/release/boost/interprocess/mem_algo/rbtree_best_fit.hpp | 142 ++--
   branches/release/boost/interprocess/offset_ptr.hpp | 43
   branches/release/boost/interprocess/segment_manager.hpp | 61 +
   branches/release/boost/interprocess/shared_memory_object.hpp | 33
   branches/release/boost/interprocess/smart_ptr/shared_ptr.hpp | 2
   branches/release/boost/interprocess/streams/bufferstream.hpp | 2
   branches/release/boost/interprocess/streams/vectorstream.hpp | 6
   branches/release/boost/interprocess/sync/emulation/interprocess_condition.hpp | 22
   branches/release/boost/interprocess/sync/file_lock.hpp | 2
   branches/release/boost/interprocess/sync/interprocess_condition.hpp | 6
   branches/release/boost/interprocess/sync/interprocess_mutex.hpp | 51 +
   branches/release/boost/interprocess/sync/interprocess_recursive_mutex.hpp | 52 +
   branches/release/boost/interprocess/sync/named_condition.hpp | 15
   branches/release/boost/interprocess/sync/named_mutex.hpp | 25
   branches/release/boost/interprocess/sync/named_recursive_mutex.hpp | 15
   branches/release/boost/interprocess/sync/named_semaphore.hpp | 28
   branches/release/boost/interprocess/sync/named_upgradable_mutex.hpp | 15
   branches/release/boost/interprocess/sync/posix/interprocess_barrier.hpp | 3
   branches/release/boost/interprocess/sync/posix/interprocess_condition.hpp | 13
   branches/release/boost/interprocess/sync/posix/interprocess_mutex.hpp | 5
   branches/release/boost/interprocess/sync/posix/interprocess_recursive_mutex.hpp | 5
   branches/release/boost/interprocess/sync/posix/pthread_helpers.hpp | 12
   branches/release/boost/interprocess/sync/posix/semaphore_wrapper.hpp | 29
   branches/release/boost/interprocess/sync/xsi/xsi_named_mutex.hpp | 5
   branches/release/boost/interprocess/windows_shared_memory.hpp | 19
   91 files changed, 4039 insertions(+), 1769 deletions(-)

Modified: branches/release/boost/interprocess/allocators/detail/adaptive_node_pool.hpp
==============================================================================
--- branches/release/boost/interprocess/allocators/detail/adaptive_node_pool.hpp (original)
+++ branches/release/boost/interprocess/allocators/detail/adaptive_node_pool.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -29,7 +29,7 @@
 #include <cstddef>
 #include <boost/config/no_tr1/cmath.hpp>
 #include <boost/interprocess/containers/container/detail/adaptive_node_pool_impl.hpp>
-#include <cassert>
+#include <boost/assert.hpp>
 
 //!\file
 //!Describes the real adaptive pool shared by many Interprocess pool allocators

Modified: branches/release/boost/interprocess/allocators/detail/allocator_common.hpp
==============================================================================
--- branches/release/boost/interprocess/allocators/detail/allocator_common.hpp (original)
+++ branches/release/boost/interprocess/allocators/detail/allocator_common.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -21,6 +21,7 @@
 #include <utility> //std::pair
 #include <boost/utility/addressof.hpp> //boost::addressof
 #include <boost/assert.hpp> //BOOST_ASSERT
+#include <boost/assert.hpp>
 #include <boost/interprocess/exceptions.hpp> //bad_alloc
 #include <boost/interprocess/sync/scoped_lock.hpp> //scoped_lock
 #include <boost/interprocess/containers/allocation_type.hpp> //boost::interprocess::allocation_type
@@ -290,6 +291,14 @@
       //Deallocate all new linked list at once
       mp_node_pool->deallocate_nodes(boost::interprocess::move(chain));
    }
+
+ public:
+ void swap(cache_impl &other)
+ {
+ detail::do_swap(mp_node_pool, other.mp_node_pool);
+ m_cached_nodes.swap(other.m_cached_nodes);
+ detail::do_swap(m_max_cached_nodes, other.m_max_cached_nodes);
+ }
 };
 
 template<class Derived, class T, class SegmentManager>
@@ -656,11 +665,7 @@
    //!Swaps allocators. Does not throw. If each allocator is placed in a
    //!different shared memory segments, the result is undefined.
    friend void swap(cached_allocator_impl &alloc1, cached_allocator_impl &alloc2)
- {
- detail::do_swap(alloc1.mp_node_pool, alloc2.mp_node_pool);
- alloc1.m_cached_nodes.swap(alloc2.m_cached_nodes);
- detail::do_swap(alloc1.m_max_cached_nodes, alloc2.m_max_cached_nodes);
- }
+ { alloc1.m_cache.swap(alloc2.m_cache); }
 
    void deallocate_cache()
    { m_cache.deallocate_all_cached_nodes(); }
@@ -808,7 +813,7 @@
       //-----------------------
       boost::interprocess::scoped_lock<mutex_type> guard(m_header);
       //-----------------------
- assert(m_header.m_usecount > 0);
+ BOOST_ASSERT(m_header.m_usecount > 0);
       return --m_header.m_usecount;
    }
 

Modified: branches/release/boost/interprocess/containers/container/deque.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/deque.hpp (original)
+++ branches/release/boost/interprocess/containers/container/deque.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -1,29 +1,3 @@
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
 //////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Ion Gaztanaga 2005-2006. Distributed under the Boost
@@ -33,13 +7,6 @@
 // See http://www.boost.org/libs/container for documentation.
 //
 //////////////////////////////////////////////////////////////////////////////
-//
-// This file comes from SGI's stl_deque.h and stl_uninitialized.h files.
-// Modified by Ion Gaztanaga 2005.
-// Renaming, isolating and porting to generic algorithms. Pointer typedef
-// set to allocator::pointer to allow placing it in shared memory.
-//
-///////////////////////////////////////////////////////////////////////////////
 
 #ifndef BOOST_CONTAINERS_DEQUE_HPP
 #define BOOST_CONTAINERS_DEQUE_HPP
@@ -48,17 +15,17 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
 
-#include <boost/interprocess/containers/container/detail/utilities.hpp>
-#include <boost/interprocess/containers/container/detail/iterators.hpp>
-#include <boost/interprocess/containers/container/detail/algorithms.hpp>
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
-#include <boost/interprocess/containers/container/container_fwd.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ITERATORS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ALGORITHMS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
 #include <cstddef>
 #include <iterator>
-#include <cassert>
+#include <boost/assert.hpp>
 #include <memory>
 #include <algorithm>
 #include <stdexcept>
@@ -68,8 +35,8 @@
 #include <boost/type_traits/has_trivial_assign.hpp>
 #include <boost/type_traits/has_nothrow_copy.hpp>
 #include <boost/type_traits/has_nothrow_assign.hpp>
-#include <boost/interprocess/detail/move.hpp>
-#include <boost/interprocess/containers/container/detail/advanced_insert_int.hpp>
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ADVANCED_INSERT_INT_HPP
 
 #ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
 namespace boost {
@@ -532,13 +499,13 @@
 
    /// @cond
    private: // Internal typedefs
- BOOST_COPYABLE_AND_MOVABLE(deque)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(deque)
    typedef ptr_alloc_ptr index_pointer;
    static std::size_t s_buffer_size()
       { return Base::s_buffer_size(); }
    typedef containers_detail::advanced_insert_aux_int<value_type, iterator> advanced_insert_aux_int_t;
    typedef repeat_iterator<T, difference_type> r_iterator;
- typedef boost::interprocess::move_iterator<r_iterator> move_it;
+ typedef BOOST_CONTAINER_MOVE_NAMESPACE::move_iterator<r_iterator> move_it;
 
    /// @endcond
 
@@ -628,7 +595,7 @@
       }
    }
 
- deque(BOOST_INTERPROCESS_RV_REF(deque) mx)
+ deque(BOOST_MOVE_MACRO_RV_REF(deque) mx)
       : Base(mx.alloc())
    { this->swap(mx); }
 
@@ -655,7 +622,7 @@
       priv_destroy_range(this->members_.m_start, this->members_.m_finish);
    }
 
- deque& operator= (BOOST_INTERPROCESS_COPY_ASSIGN_REF(deque) x)
+ deque& operator= (BOOST_MOVE_MACRO_COPY_ASSIGN_REF(deque) x)
    {
       const size_type len = size();
       if (&x != this) {
@@ -670,7 +637,7 @@
       return *this;
    }
 
- deque& operator= (BOOST_INTERPROCESS_RV_REF(deque) x)
+ deque& operator= (BOOST_MOVE_MACRO_RV_REF(deque) x)
    {
       this->clear();
       this->swap(x);
@@ -697,21 +664,21 @@
       this->priv_assign_dispatch(first, last, Result());
    }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    void push_back(T &x) { push_back(const_cast<const T &>(x)); }
 
    template<class U>
- void push_back(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ void push_back(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return priv_push_back(u); }
    #endif
 
    void push_back(insert_const_ref_type t)
    { return priv_push_back(t); }
 
- void push_back(BOOST_INTERPROCESS_RV_REF(value_type) t)
+ void push_back(BOOST_MOVE_MACRO_RV_REF(value_type) t)
    {
       if(this->priv_push_back_simple_available()){
- new(this->priv_push_back_simple_pos())value_type(boost::interprocess::move(t));
+ new(this->priv_push_back_simple_pos())value_type(BOOST_CONTAINER_MOVE_NAMESPACE::move(t));
          this->priv_push_back_simple_commit();
       }
       else{
@@ -719,21 +686,21 @@
       }
    }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    void push_front(T &x) { push_front(const_cast<const T &>(x)); }
 
    template<class U>
- void push_front(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ void push_front(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return priv_push_front(u); }
    #endif
 
    void push_front(insert_const_ref_type t)
    { return priv_push_front(t); }
 
- void push_front(BOOST_INTERPROCESS_RV_REF(value_type) t)
+ void push_front(BOOST_MOVE_MACRO_RV_REF(value_type) t)
    {
       if(this->priv_push_front_simple_available()){
- new(this->priv_push_front_simple_pos())value_type(boost::interprocess::move(t));
+ new(this->priv_push_front_simple_pos())value_type(BOOST_CONTAINER_MOVE_NAMESPACE::move(t));
          this->priv_push_front_simple_commit();
       }
       else{
@@ -761,26 +728,26 @@
          this->priv_pop_front_aux();
    }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    iterator insert(const_iterator position, T &x)
    { return this->insert(position, const_cast<const T &>(x)); }
 
    template<class U>
- iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return this->priv_insert(position, u); }
    #endif
 
    iterator insert(const_iterator position, insert_const_ref_type x)
    { return this->priv_insert(position, x); }
 
- iterator insert(const_iterator position, BOOST_INTERPROCESS_RV_REF(value_type) mx)
+ iterator insert(const_iterator position, BOOST_MOVE_MACRO_RV_REF(value_type) mx)
    {
       if (position == cbegin()) {
- this->push_front(boost::interprocess::move(mx));
+ this->push_front(BOOST_CONTAINER_MOVE_NAMESPACE::move(mx));
          return begin();
       }
       else if (position == cend()) {
- this->push_back(boost::interprocess::move(mx));
+ this->push_back(BOOST_CONTAINER_MOVE_NAMESPACE::move(mx));
          return(end()-1);
       }
       else {
@@ -810,12 +777,12 @@
    void emplace_back(Args&&... args)
    {
       if(this->priv_push_back_simple_available()){
- new(this->priv_push_back_simple_pos())value_type(boost::interprocess::forward<Args>(args)...);
+ new(this->priv_push_back_simple_pos())value_type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
          this->priv_push_back_simple_commit();
       }
       else{
          typedef containers_detail::advanced_insert_aux_emplace<T, iterator, Args...> type;
- type &&proxy = type(boost::interprocess::forward<Args>(args)...);
+ type &&proxy = type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
          this->priv_insert_aux_impl(this->cend(), 1, proxy);
       }
    }
@@ -824,12 +791,12 @@
    void emplace_front(Args&&... args)
    {
       if(this->priv_push_front_simple_available()){
- new(this->priv_push_front_simple_pos())value_type(boost::interprocess::forward<Args>(args)...);
+ new(this->priv_push_front_simple_pos())value_type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
          this->priv_push_front_simple_commit();
       }
       else{
          typedef containers_detail::advanced_insert_aux_emplace<T, iterator, Args...> type;
- type &&proxy = type(boost::interprocess::forward<Args>(args)...);
+ type &&proxy = type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
          this->priv_insert_aux_impl(this->cbegin(), 1, proxy);
       }
    }
@@ -838,17 +805,17 @@
    iterator emplace(const_iterator p, Args&&... args)
    {
       if(p == this->cbegin()){
- this->emplace_front(boost::interprocess::forward<Args>(args)...);
+ this->emplace_front(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
          return this->begin();
       }
       else if(p == this->cend()){
- this->emplace_back(boost::interprocess::forward<Args>(args)...);
+ this->emplace_back(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
          return (this->end()-1);
       }
       else{
          size_type n = p - this->cbegin();
          typedef containers_detail::advanced_insert_aux_emplace<T, iterator, Args...> type;
- type &&proxy = type(boost::interprocess::forward<Args>(args)...);
+ type &&proxy = type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
          this->priv_insert_aux_impl(p, 1, proxy);
          return iterator(this->begin() + n);
       }
@@ -986,11 +953,11 @@
       ++next;
       difference_type index = pos - this->members_.m_start;
       if (size_type(index) < (this->size() >> 1)) {
- boost::interprocess::move_backward(begin(), iterator(pos), iterator(next));
+ BOOST_CONTAINER_MOVE_NAMESPACE::move_backward(begin(), iterator(pos), iterator(next));
          pop_front();
       }
       else {
- boost::interprocess::move(iterator(next), end(), iterator(pos));
+ BOOST_CONTAINER_MOVE_NAMESPACE::move(iterator(next), end(), iterator(pos));
          pop_back();
       }
       return this->members_.m_start + index;
@@ -1006,7 +973,7 @@
          difference_type n = last - first;
          difference_type elems_before = first - this->members_.m_start;
          if (elems_before < static_cast<difference_type>(this->size() - n) - elems_before) {
- boost::interprocess::move_backward(begin(), iterator(first), iterator(last));
+ BOOST_CONTAINER_MOVE_NAMESPACE::move_backward(begin(), iterator(first), iterator(last));
             iterator new_start = this->members_.m_start + n;
             if(!Base::traits_t::trivial_dctr_after_move)
                this->priv_destroy_range(this->members_.m_start, new_start);
@@ -1014,7 +981,7 @@
             this->members_.m_start = new_start;
          }
          else {
- boost::interprocess::move(iterator(last), end(), iterator(first));
+ BOOST_CONTAINER_MOVE_NAMESPACE::move(iterator(last), end(), iterator(first));
             iterator new_finish = this->members_.m_finish - n;
             if(!Base::traits_t::trivial_dctr_after_move)
                this->priv_destroy_range(new_finish, this->members_.m_finish);
@@ -1120,7 +1087,7 @@
    void priv_insert_aux(const_iterator pos, InpIt first, InpIt last, std::input_iterator_tag)
    {
       for(;first != last; ++first){
- this->insert(pos, boost::interprocess::move(value_type(*first)));
+ this->insert(pos, BOOST_CONTAINER_MOVE_NAMESPACE::move(value_type(*first)));
       }
    }
 
@@ -1172,7 +1139,7 @@
 
    template <class Integer>
    void priv_assign_dispatch(Integer n, Integer val, containers_detail::true_)
- { this->priv_fill_assign((size_type) n, (T) val); }
+ { this->priv_fill_assign((size_type) n, (value_type)val); }
 
    template <class InpIt>
    void priv_assign_dispatch(InpIt first, InpIt last, containers_detail::false_)
@@ -1209,7 +1176,7 @@
 
    template <class Integer>
    void priv_insert_dispatch(const_iterator pos, Integer n, Integer x, containers_detail::true_)
- { this->priv_fill_insert(pos, (size_type) n, (value_type) x); }
+ { this->priv_fill_insert(pos, (size_type) n, (value_type)x); }
 
    template <class InpIt>
    void priv_insert_dispatch(const_iterator pos,InpIt first, InpIt last, containers_detail::false_)
@@ -1248,9 +1215,9 @@
          pos = this->members_.m_start + elemsbefore;
          if (elemsbefore >= difference_type(n)) {
             iterator start_n = this->members_.m_start + difference_type(n);
- ::boost::interprocess::uninitialized_move(this->members_.m_start, start_n, new_start);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move(this->members_.m_start, start_n, new_start);
             this->members_.m_start = new_start;
- boost::interprocess::move(start_n, pos, old_start);
+ BOOST_CONTAINER_MOVE_NAMESPACE::move(start_n, pos, old_start);
             interf.copy_all_to(pos - difference_type(n));
          }
          else {
@@ -1258,7 +1225,7 @@
             iterator mid_start = old_start - mid_count;
             interf.uninitialized_copy_some_and_update(mid_start, mid_count, true);
             this->members_.m_start = mid_start;
- ::boost::interprocess::uninitialized_move(old_start, pos, new_start);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move(old_start, pos, new_start);
             this->members_.m_start = new_start;
             interf.copy_all_to(old_start);
          }
@@ -1271,15 +1238,15 @@
          pos = this->members_.m_finish - elemsafter;
          if (elemsafter >= difference_type(n)) {
             iterator finish_n = this->members_.m_finish - difference_type(n);
- ::boost::interprocess::uninitialized_move(finish_n, this->members_.m_finish, this->members_.m_finish);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move(finish_n, this->members_.m_finish, this->members_.m_finish);
             this->members_.m_finish = new_finish;
- boost::interprocess::move_backward(pos, finish_n, old_finish);
+ BOOST_CONTAINER_MOVE_NAMESPACE::move_backward(pos, finish_n, old_finish);
             interf.copy_all_to(pos);
          }
          else {
             interf.uninitialized_copy_some_and_update(old_finish, elemsafter, false);
             this->members_.m_finish += n-elemsafter;
- ::boost::interprocess::uninitialized_move(pos, old_finish, this->members_.m_finish);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move(pos, old_finish, this->members_.m_finish);
             this->members_.m_finish = new_finish;
             interf.copy_all_to(pos);
          }
@@ -1339,10 +1306,10 @@
                ++cur_node) {
             FwdIt mid = first;
             std::advance(mid, this->s_buffer_size());
- ::boost::interprocess::uninitialized_copy_or_move(first, mid, *cur_node);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_copy_or_move(first, mid, *cur_node);
             first = mid;
          }
- ::boost::interprocess::uninitialized_copy_or_move(first, last, this->members_.m_finish.m_first);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_copy_or_move(first, last, this->members_.m_finish.m_first);
       }
       BOOST_CATCH(...){
          this->priv_destroy_range(this->members_.m_start, iterator(*cur_node, cur_node));
@@ -1433,9 +1400,9 @@
          new_nstart = this->members_.m_map + (this->members_.m_map_size - new_num_nodes) / 2
                            + (add_at_front ? nodes_to_add : 0);
          if (new_nstart < this->members_.m_start.m_node)
- boost::interprocess::move(this->members_.m_start.m_node, this->members_.m_finish.m_node + 1, new_nstart);
+ BOOST_CONTAINER_MOVE_NAMESPACE::move(this->members_.m_start.m_node, this->members_.m_finish.m_node + 1, new_nstart);
          else
- boost::interprocess::move_backward
+ BOOST_CONTAINER_MOVE_NAMESPACE::move_backward
                (this->members_.m_start.m_node, this->members_.m_finish.m_node + 1, new_nstart + old_num_nodes);
       }
       else {
@@ -1445,7 +1412,7 @@
          index_pointer new_map = this->priv_allocate_map(new_map_size);
          new_nstart = new_map + (new_map_size - new_num_nodes) / 2
                               + (add_at_front ? nodes_to_add : 0);
- boost::interprocess::move(this->members_.m_start.m_node, this->members_.m_finish.m_node + 1, new_nstart);
+ BOOST_CONTAINER_MOVE_NAMESPACE::move(this->members_.m_start.m_node, this->members_.m_finish.m_node + 1, new_nstart);
          this->priv_deallocate_map(this->members_.m_map, this->members_.m_map_size);
 
          this->members_.m_map = new_map;
@@ -1516,6 +1483,6 @@
 
 /// @endcond
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif // #ifndef BOOST_CONTAINERS_DEQUE_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/adaptive_node_pool_impl.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/adaptive_node_pool_impl.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/adaptive_node_pool_impl.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -15,18 +15,18 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/container_fwd.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
-#include <boost/interprocess/containers/container/detail/utilities.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP
 #include <boost/pointer_to_other.hpp>
 #include <boost/intrusive/set.hpp>
 #include <boost/intrusive/slist.hpp>
-#include <boost/interprocess/containers/container/detail/type_traits.hpp>
-#include <boost/interprocess/containers/container/detail/math_functions.hpp>
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
-#include <boost/interprocess/containers/container/detail/pool_common.hpp>
-#include <cassert>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_TYPE_TRAITS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MATH_FUNCTIONS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_POOL_COMMON_HPP
+#include <boost/assert.hpp>
 #include <cstddef>
 
 namespace boost {
@@ -69,6 +69,9 @@
          const bool is_equal = l.free_nodes.size() == r.free_nodes.size();
          return is_less || (is_equal && (&l < &r));
       }
+
+ friend bool operator ==(const block_info_t &l, const block_info_t &r)
+ { return &l == &r; }
    };
    typedef typename bi::make_multiset
       <block_info_t, bi::base_hook<multiset_hook_t> >::type block_multiset_t;
@@ -270,11 +273,11 @@
          }
       }
       catch(...){
- this->deallocate_nodes(boost::interprocess::move(chain));
+ this->deallocate_nodes(BOOST_CONTAINER_MOVE_NAMESPACE::move(chain));
          throw;
       }
       priv_invariants();
- return boost::interprocess::move(chain);
+ return BOOST_CONTAINER_MOVE_NAMESPACE::move(chain);
    }
 
    //!Deallocates a linked list of nodes. Never throws
@@ -302,10 +305,10 @@
 
    void swap(private_adaptive_node_pool_impl &other)
    {
- assert(m_max_free_blocks == other.m_max_free_blocks);
- assert(m_real_node_size == other.m_real_node_size);
- assert(m_real_block_alignment == other.m_real_block_alignment);
- assert(m_real_num_node == other.m_real_num_node);
+ BOOST_ASSERT(m_max_free_blocks == other.m_max_free_blocks);
+ BOOST_ASSERT(m_real_node_size == other.m_real_node_size);
+ BOOST_ASSERT(m_real_block_alignment == other.m_real_block_alignment);
+ BOOST_ASSERT(m_real_num_node == other.m_real_num_node);
       std::swap(mp_segment_mngr_base, other.mp_segment_mngr_base);
       std::swap(m_totally_free_blocks, other.m_totally_free_blocks);
       m_block_multiset.swap(other.m_block_multiset);
@@ -326,10 +329,10 @@
          ; m_totally_free_blocks > max_free_blocks
          ; --m_totally_free_blocks
          ){
- assert(!m_block_multiset.empty());
+ BOOST_ASSERT(!m_block_multiset.empty());
          block_iterator it = itend;
          --it;
- assert(it->free_nodes.size() == m_real_num_node);
+ BOOST_ASSERT(it->free_nodes.size() == m_real_num_node);
          m_block_multiset.erase_and_dispose(it, block_destroyer(this));
       }
    }
@@ -342,7 +345,7 @@
          chain.pop_front();
          priv_invariants();
          block_info_t *block_info = this->priv_block_from_node(pElem);
- assert(block_info->free_nodes.size() < m_real_num_node);
+ BOOST_ASSERT(block_info->free_nodes.size() < m_real_num_node);
          //We put the node at the beginning of the free node list
          node_t * to_deallocate = static_cast<node_t*>(pElem);
          block_info->free_nodes.push_front(*to_deallocate);
@@ -379,12 +382,12 @@
 
    node_t *priv_take_first_node()
    {
- assert(m_block_multiset.begin() != m_block_multiset.end());
+ BOOST_ASSERT(m_block_multiset.begin() != m_block_multiset.end());
       //We take the first free node the multiset can't be empty
       free_nodes_t &free_nodes = m_block_multiset.begin()->free_nodes;
       node_t *first_node = &free_nodes.front();
       const std::size_t free_nodes_count = free_nodes.size();
- assert(0 != free_nodes_count);
+ BOOST_ASSERT(0 != free_nodes_count);
       free_nodes.pop_front();
       if(free_nodes_count == 1){
          m_block_multiset.erase(m_block_multiset.begin());
@@ -414,7 +417,7 @@
       {
          std::size_t free_nodes = to_deallocate->free_nodes.size();
          (void)free_nodes;
- assert(free_nodes == mp_impl->m_real_num_node);
+ BOOST_ASSERT(free_nodes == mp_impl->m_real_num_node);
          mp_impl->mp_segment_mngr_base->deallocate(to_deallocate);
       }
 
@@ -422,8 +425,8 @@
       {
          std::size_t free_nodes = to_deallocate->free_nodes.size();
          (void)free_nodes;
- assert(free_nodes == mp_impl->m_real_num_node);
- assert(0 == to_deallocate->hdr_offset);
+ BOOST_ASSERT(free_nodes == mp_impl->m_real_num_node);
+ BOOST_ASSERT(0 == to_deallocate->hdr_offset);
          hdr_offset_holder *hdr_off_holder = mp_impl->priv_first_subblock_from_block(containers_detail::get_pointer(to_deallocate));
          mp_impl->mp_segment_mngr_base->deallocate(hdr_off_holder);
       }
@@ -446,7 +449,7 @@
             --prev;
             std::size_t sp = prev->free_nodes.size(),
                         si = it->free_nodes.size();
- assert(sp <= si);
+ BOOST_ASSERT(sp <= si);
             (void)sp; (void)si;
          }
       }
@@ -457,7 +460,7 @@
       for(; it != itend; ++it){
          total_free_nodes += it->free_nodes.size();
       }
- assert(total_free_nodes >= m_totally_free_blocks*m_real_num_node);
+ BOOST_ASSERT(total_free_nodes >= m_totally_free_blocks*m_real_num_node);
 
       //Check that the total totally free blocks are correct
       it = m_block_multiset.begin();
@@ -466,7 +469,7 @@
       for(; it != itend; ++it){
          total_free += it->free_nodes.size() == m_real_num_node;
       }
- assert(total_free >= m_totally_free_blocks);
+ BOOST_ASSERT(total_free >= m_totally_free_blocks);
 
       if(!AlignOnly){
          //Check that header offsets are correct
@@ -474,9 +477,9 @@
          for(; it != itend; ++it){
             hdr_offset_holder *hdr_off_holder = priv_first_subblock_from_block(&*it);
             for(std::size_t i = 0, max = m_num_subblocks; i < max; ++i){
- assert(hdr_off_holder->hdr_offset == std::size_t(reinterpret_cast<char*>(&*it)- reinterpret_cast<char*>(hdr_off_holder)));
- assert(0 == ((std::size_t)hdr_off_holder & (m_real_block_alignment - 1)));
- assert(0 == (hdr_off_holder->hdr_offset & (m_real_block_alignment - 1)));
+ BOOST_ASSERT(hdr_off_holder->hdr_offset == std::size_t(reinterpret_cast<char*>(&*it)- reinterpret_cast<char*>(hdr_off_holder)));
+ BOOST_ASSERT(0 == ((std::size_t)hdr_off_holder & (m_real_block_alignment - 1)));
+ BOOST_ASSERT(0 == (hdr_off_holder->hdr_offset & (m_real_block_alignment - 1)));
                hdr_off_holder = reinterpret_cast<hdr_offset_holder *>(reinterpret_cast<char*>(hdr_off_holder) + m_real_block_alignment);
             }
          }
@@ -495,10 +498,10 @@
       std::size_t num_free_nodes = 0;
       for(; it != itend; ++it){
          //Check for memory leak
- assert(it->free_nodes.size() == m_real_num_node);
+ BOOST_ASSERT(it->free_nodes.size() == m_real_num_node);
          ++num_free_nodes;
       }
- assert(num_free_nodes == m_totally_free_blocks);
+ BOOST_ASSERT(num_free_nodes == m_totally_free_blocks);
       #endif
       //Check for memory leaks
       priv_invariants();
@@ -510,11 +513,11 @@
    {
       hdr_offset_holder *hdr_off_holder =
          reinterpret_cast<hdr_offset_holder*>((std::size_t)node & std::size_t(~(m_real_block_alignment - 1)));
- assert(0 == ((std::size_t)hdr_off_holder & (m_real_block_alignment - 1)));
- assert(0 == (hdr_off_holder->hdr_offset & (m_real_block_alignment - 1)));
+ BOOST_ASSERT(0 == ((std::size_t)hdr_off_holder & (m_real_block_alignment - 1)));
+ BOOST_ASSERT(0 == (hdr_off_holder->hdr_offset & (m_real_block_alignment - 1)));
       block_info_t *block = reinterpret_cast<block_info_t *>
          (reinterpret_cast<char*>(hdr_off_holder) + hdr_off_holder->hdr_offset);
- assert(block->hdr_offset == 0);
+ BOOST_ASSERT(block->hdr_offset == 0);
       return block;
    }
 
@@ -530,9 +533,9 @@
    {
       hdr_offset_holder *hdr_off_holder = reinterpret_cast<hdr_offset_holder*>
             (reinterpret_cast<char*>(block) - (m_num_subblocks-1)*m_real_block_alignment);
- assert(hdr_off_holder->hdr_offset == std::size_t(reinterpret_cast<char*>(block) - reinterpret_cast<char*>(hdr_off_holder)));
- assert(0 == ((std::size_t)hdr_off_holder & (m_real_block_alignment - 1)));
- assert(0 == (hdr_off_holder->hdr_offset & (m_real_block_alignment - 1)));
+ BOOST_ASSERT(hdr_off_holder->hdr_offset == std::size_t(reinterpret_cast<char*>(block) - reinterpret_cast<char*>(hdr_off_holder)));
+ BOOST_ASSERT(0 == ((std::size_t)hdr_off_holder & (m_real_block_alignment - 1)));
+ BOOST_ASSERT(0 == (hdr_off_holder->hdr_offset & (m_real_block_alignment - 1)));
       return hdr_off_holder;
    }
 
@@ -579,7 +582,7 @@
          char *hdr_addr = mem_address + m_real_block_alignment*(m_num_subblocks-1);
          block_info_t *c_info = new(hdr_addr)block_info_t;
          //Some structural checks
- assert(static_cast<void*>(&static_cast<hdr_offset_holder*>(c_info)->hdr_offset) ==
+ BOOST_ASSERT(static_cast<void*>(&static_cast<hdr_offset_holder*>(c_info)->hdr_offset) ==
                 static_cast<void*>(c_info));
          typename free_nodes_t::iterator prev_insert_pos = c_info->free_nodes.before_begin();
          for( std::size_t subblock = 0, maxsubblock = m_num_subblocks - 1
@@ -633,6 +636,6 @@
 } //namespace container {
 } //namespace boost {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //#ifndef BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/advanced_insert_int.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/advanced_insert_int.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/advanced_insert_int.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -15,13 +15,12 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
-#include <boost/interprocess/detail/move.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 #include <iterator> //std::iterator_traits
-#include <algorithm> //std::copy, std::uninitialized_copy
 #include <new> //placement new
-#include <cassert>
+#include <boost/assert.hpp>
 
 namespace boost { namespace container { namespace containers_detail {
 
@@ -51,21 +50,21 @@
    {}
 
    virtual void copy_all_to(Iterator p)
- { std::copy(first_, last_, p); }
+ { ::BOOST_CONTAINER_MOVE_NAMESPACE::copy_or_move(first_, last_, p); }
 
    virtual void uninitialized_copy_all_to(Iterator p)
- { ::boost::interprocess::uninitialized_copy_or_move(first_, last_, p); }
+ { ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_copy_or_move(first_, last_, p); }
 
    virtual void uninitialized_copy_some_and_update(Iterator pos, difference_type division_count, bool first_n)
    {
       FwdIt mid = first_;
       std::advance(mid, division_count);
       if(first_n){
- ::boost::interprocess::uninitialized_copy_or_move(first_, mid, pos);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_copy_or_move(first_, mid, pos);
          first_ = mid;
       }
       else{
- ::boost::interprocess::uninitialized_copy_or_move(mid, last_, pos);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_copy_or_move(mid, last_, pos);
          last_ = mid;
       }
    }
@@ -75,11 +74,11 @@
       FwdIt mid = first_;
       std::advance(mid, division_count);
       if(first_n){
- std::copy(first_, mid, pos);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::copy_or_move(first_, mid, pos);
          first_ = mid;
       }
       else{
- std::copy(mid, last_, pos);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::copy_or_move(mid, last_, pos);
          last_ = mid;
       }
    }
@@ -99,7 +98,7 @@
 
    void uninitialized_copy_impl(Iterator p, const SizeType n)
    {
- assert(n <= count_);
+ BOOST_ASSERT(n <= count_);
       Iterator orig_p = p;
       SizeType i = 0;
       try{
@@ -121,7 +120,7 @@
 
    virtual void copy_all_to(Iterator)
    { //This should never be called with any count
- assert(count_ == 0);
+ BOOST_ASSERT(count_ == 0);
    }
 
    virtual void uninitialized_copy_all_to(Iterator p)
@@ -134,7 +133,7 @@
          new_count = division_count;
       }
       else{
- assert(difference_type(count_)>= division_count);
+ BOOST_ASSERT(difference_type(count_)>= division_count);
          new_count = count_ - division_count;
       }
       this->uninitialized_copy_impl(pos, new_count);
@@ -142,17 +141,17 @@
 
    virtual void copy_some_and_update(Iterator , difference_type division_count, bool first_n)
    {
- assert(count_ == 0);
+ BOOST_ASSERT(count_ == 0);
       SizeType new_count;
       if(first_n){
          new_count = division_count;
       }
       else{
- assert(difference_type(count_)>= division_count);
+ BOOST_ASSERT(difference_type(count_)>= division_count);
          new_count = count_ - division_count;
       }
       //This function should never called with a count different to zero
- assert(new_count == 0);
+ BOOST_ASSERT(new_count == 0);
       (void)new_count;
    }
 
@@ -163,8 +162,9 @@
 
 #ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
 
-#include <boost/interprocess/containers/container/detail/variadic_templates_tools.hpp>
-#include <boost/interprocess/detail/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_STORED_REF_HPP
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 #include <typeinfo>
 //#include <iostream> //For debugging purposes
 
@@ -181,7 +181,8 @@
    typedef typename build_number_seq<sizeof...(Args)>::type index_tuple_t;
 
    explicit advanced_insert_aux_emplace(Args&&... args)
- : args_(args...), used_(false)
+ : args_(args...)
+ , used_(false)
    {}
 
    ~advanced_insert_aux_emplace()
@@ -204,7 +205,7 @@
    void priv_copy_all_to(const index_tuple<IdxPack...>&, Iterator p)
    {
       if(!used_){
- *p = boost::interprocess::move(T (boost::interprocess::forward<Args>(get<IdxPack>(args_))...));
+ *p = BOOST_CONTAINER_MOVE_NAMESPACE::move(T (::boost::container::containers_detail::stored_ref<Args>::forward(get<IdxPack>(args_))...));
          used_ = true;
       }
    }
@@ -213,7 +214,7 @@
    void priv_uninitialized_copy_all_to(const index_tuple<IdxPack...>&, Iterator p)
    {
       if(!used_){
- new(containers_detail::get_pointer(&*p))T(boost::interprocess::forward<Args>(get<IdxPack>(args_))...);
+ new(containers_detail::get_pointer(&*p))T(::boost::container::containers_detail::stored_ref<Args>::forward(get<IdxPack>(args_))...);
          used_ = true;
       }
    }
@@ -221,10 +222,10 @@
    template<int ...IdxPack>
    void priv_uninitialized_copy_some_and_update(const index_tuple<IdxPack...>&, Iterator p, difference_type division_count, bool first_n)
    {
- assert(division_count <=1);
+ BOOST_ASSERT(division_count <=1);
       if((first_n && division_count == 1) || (!first_n && division_count == 0)){
          if(!used_){
- new(containers_detail::get_pointer(&*p))T(boost::interprocess::forward<Args>(get<IdxPack>(args_))...);
+ new(containers_detail::get_pointer(&*p))T(::boost::container::containers_detail::stored_ref<Args>::forward(get<IdxPack>(args_))...);
             used_ = true;
          }
       }
@@ -233,15 +234,15 @@
    template<int ...IdxPack>
    void priv_copy_some_and_update(const index_tuple<IdxPack...>&, Iterator p, difference_type division_count, bool first_n)
    {
- assert(division_count <=1);
+ BOOST_ASSERT(division_count <=1);
       if((first_n && division_count == 1) || (!first_n && division_count == 0)){
          if(!used_){
- *p = boost::interprocess::move(T(boost::interprocess::forward<Args>(get<IdxPack>(args_))...));
+ *p = BOOST_CONTAINER_MOVE_NAMESPACE::move(T(::boost::container::containers_detail::stored_ref<Args>::forward(get<IdxPack>(args_))...));
             used_ = true;
          }
       }
    }
- tuple<Args&&...> args_;
+ tuple<Args&...> args_;
    bool used_;
 };
 
@@ -249,8 +250,8 @@
 
 #else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
 
-#include <boost/interprocess/containers/container/detail/preprocessor.hpp>
-#include <boost/interprocess/containers/container/detail/value_init.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_VALUE_INIT_HPP
 
 namespace boost {
 namespace container {
@@ -273,7 +274,7 @@
    {
       if(!used_){
          value_init<T>v;
- *p = boost::interprocess::move(v.m_t);
+ *p = BOOST_CONTAINER_MOVE_NAMESPACE::move(v.m_t);
          used_ = true;
       }
    }
@@ -288,7 +289,7 @@
 
    virtual void uninitialized_copy_some_and_update(Iterator p, difference_type division_count, bool first_n)
    {
- assert(division_count <=1);
+ BOOST_ASSERT(division_count <=1);
       if((first_n && division_count == 1) || (!first_n && division_count == 0)){
          if(!used_){
             new(containers_detail::get_pointer(&*p))T();
@@ -299,11 +300,11 @@
 
    virtual void copy_some_and_update(Iterator p, difference_type division_count, bool first_n)
    {
- assert(division_count <=1);
+ BOOST_ASSERT(division_count <=1);
       if((first_n && division_count == 1) || (!first_n && division_count == 0)){
          if(!used_){
             value_init<T>v;
- *p = boost::interprocess::move(v.m_t);
+ *p = BOOST_CONTAINER_MOVE_NAMESPACE::move(v.m_t);
             used_ = true;
          }
       }
@@ -327,7 +328,7 @@
       { \
          if(!used_){ \
             T v(BOOST_PP_ENUM(n, BOOST_CONTAINERS_PP_MEMBER_FORWARD, _)); \
- *p = boost::interprocess::move(v); \
+ *p = BOOST_CONTAINER_MOVE_NAMESPACE::move(v); \
             used_ = true; \
          } \
       } \
@@ -344,7 +345,7 @@
       virtual void uninitialized_copy_some_and_update \
          (Iterator p, difference_type division_count, bool first_n) \
       { \
- assert(division_count <=1); \
+ BOOST_ASSERT(division_count <=1); \
          if((first_n && division_count == 1) || (!first_n && division_count == 0)){ \
             if(!used_){ \
                new(containers_detail::get_pointer(&*p))T \
@@ -357,11 +358,11 @@
       virtual void copy_some_and_update \
          (Iterator p, difference_type division_count, bool first_n) \
       { \
- assert(division_count <=1); \
+ BOOST_ASSERT(division_count <=1); \
          if((first_n && division_count == 1) || (!first_n && division_count == 0)){ \
             if(!used_){ \
                T v(BOOST_PP_ENUM(n, BOOST_CONTAINERS_PP_MEMBER_FORWARD, _)); \
- *p = boost::interprocess::move(v); \
+ *p = BOOST_CONTAINER_MOVE_NAMESPACE::move(v); \
                used_ = true; \
             } \
          } \
@@ -379,6 +380,6 @@
 
 #endif //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //#ifndef BOOST_CONTAINERS_ADVANCED_INSERT_INT_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/algorithms.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/algorithms.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/algorithms.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -17,17 +17,17 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
 
 #include <boost/type_traits/has_trivial_copy.hpp>
 #include <boost/type_traits/has_trivial_assign.hpp>
 #include <boost/detail/no_exceptions_support.hpp>
 #include <boost/get_pointer.hpp>
 
-#include <boost/interprocess/containers/container/detail/type_traits.hpp>
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
-#include <boost/interprocess/containers/container/detail/iterators.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_TYPE_TRAITS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ITERATORS_HPP
 
 
 #include <cstring>
@@ -35,7 +35,7 @@
 namespace boost {
 namespace container {
 
-#if !defined(BOOST_HAS_RVALUE_REFS)
+#if defined(BOOST_NO_RVALUE_REFERENCES)
 template<class T>
 struct has_own_construct_from_it
 {
@@ -209,7 +209,7 @@
 } //namespace container {
 } //namespace boost {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //#ifndef BOOST_CONTAINERS_DETAIL_ALGORITHMS_HPP
 

Modified: branches/release/boost/interprocess/containers/container/detail/allocation_type.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/allocation_type.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/allocation_type.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -15,8 +15,8 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
 
 namespace boost {
 namespace container {
@@ -49,6 +49,6 @@
 } //namespace container {
 } //namespace boost {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //BOOST_CONTAINERS_ALLOCATION_TYPE_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/config_begin.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/config_begin.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/config_begin.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -10,6 +10,104 @@
 #ifndef BOOST_CONTAINERS_CONTAINER_DETAIL_CONFIG_INCLUDED
 #define BOOST_CONTAINERS_CONTAINER_DETAIL_CONFIG_INCLUDED
 #include <boost/config.hpp>
+
+#define BOOST_CONTAINER_IN_INTERPROCESS
+#define BOOST_MOVE_IN_INTERPROCESS
+
+#ifdef BOOST_MOVE_IN_INTERPROCESS
+
+#define INCLUDE_BOOST_CONTAINER_MOVE_HPP <boost/interprocess/detail/move.hpp>
+#define BOOST_CONTAINER_MOVE_NAMESPACE boost::interprocess
+
+#else
+
+#define INCLUDE_BOOST_CONTAINER_MOVE_HPP <boost/move/move.hpp>
+#define BOOST_CONTAINER_MOVE_NAMESPACE boost
+
+#endif
+
+#ifdef BOOST_CONTAINER_IN_INTERPROCESS
+
+#define INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP <boost/interprocess/containers/container/container_fwd.hpp>
+#define INCLUDE_BOOST_CONTAINER_DEQUE_HPP <boost/interprocess/containers/container/deque.hpp>
+#define INCLUDE_BOOST_CONTAINER_FLAT_MAP_HPP <boost/interprocess/containers/container/flat_map.hpp>
+#define INCLUDE_BOOST_CONTAINER_FLAT_SET_HPP <boost/interprocess/containers/container/flat_set.hpp>
+#define INCLUDE_BOOST_CONTAINER_LIST_HPP <boost/interprocess/containers/container/list.hpp>
+#define INCLUDE_BOOST_CONTAINER_MAP_HPP <boost/interprocess/containers/container/map.hpp>
+#define INCLUDE_BOOST_CONTAINER_SET_HPP <boost/interprocess/containers/container/set.hpp>
+#define INCLUDE_BOOST_CONTAINER_SLIST_HPP <boost/interprocess/containers/container/slist.hpp>
+#define INCLUDE_BOOST_CONTAINER_STABLE_VECTOR_HPP <boost/interprocess/containers/container/stable_vector.hpp>
+#define INCLUDE_BOOST_CONTAINER_STRING_HPP <boost/interprocess/containers/container/string.hpp>
+#define INCLUDE_BOOST_CONTAINER_VECTOR_HPP <boost/interprocess/containers/container/vector.hpp>
+//detail
+#define INCLUDE_BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP <boost/interprocess/containers/container/detail/adaptive_node_pool_impl.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_ADVANCED_INSERT_INT_HPP <boost/interprocess/containers/container/detail/advanced_insert_int.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_ALGORITHMS_HPP <boost/interprocess/containers/container/detail/algorithms.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_ALLOCATION_TYPE_HPP <boost/interprocess/containers/container/detail/allocation_type.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP <boost/interprocess/containers/container/detail/config_end.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_DESTROYERS_HPP <boost/interprocess/containers/container/detail/destroyers.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_FLAT_TREE_HPP <boost/interprocess/containers/container/detail/flat_tree.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_ITERATORS_HPP <boost/interprocess/containers/container/detail/iterators.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_MATH_FUNCTIONS_HPP <boost/interprocess/containers/container/detail/math_functions.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP <boost/interprocess/containers/container/detail/mpl.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_MULTIALLOCATION_CHAIN_HPP <boost/interprocess/containers/container/detail/multiallocation_chain.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_NODE_ALLOC_HOLDER_HPP <boost/interprocess/containers/container/detail/node_alloc_holder.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_NODE_POOL_IMPL_HPP <boost/interprocess/containers/container/detail/node_pool_impl.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_PAIR_HPP <boost/interprocess/containers/container/detail/pair.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_POOL_COMMON_HPP <boost/interprocess/containers/container/detail/pool_common.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP <boost/interprocess/containers/container/detail/preprocessor.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_TRANSFORM_ITERATOR_HPP <boost/interprocess/containers/container/detail/transform_iterator.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_TREE_HPP <boost/interprocess/containers/container/detail/tree.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_TYPE_TRAITS_HPP <boost/interprocess/containers/container/detail/type_traits.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP <boost/interprocess/containers/container/detail/utilities.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_VALUE_INIT_HPP <boost/interprocess/containers/container/detail/value_init.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP <boost/interprocess/containers/container/detail/variadic_templates_tools.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_STORED_REF_HPP <boost/interprocess/containers/container/detail/stored_ref.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP <boost/interprocess/containers/container/detail/version_type.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP <boost/interprocess/containers/container/detail/workaround.hpp>
+
+#else //BOOST_CONTAINER_IN_INTERPROCESS
+
+#define INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP <boost/container/container_fwd.hpp>
+#define INCLUDE_BOOST_CONTAINER_DEQUE_HPP <boost/container/deque.hpp>
+#define INCLUDE_BOOST_CONTAINER_FLAT_MAP_HPP <boost/container/flat_map.hpp>
+#define INCLUDE_BOOST_CONTAINER_FLAT_SET_HPP <boost/container/flat_set.hpp>
+#define INCLUDE_BOOST_CONTAINER_LIST_HPP <boost/container/list.hpp>
+#define INCLUDE_BOOST_CONTAINER_MAP_HPP <boost/container/map.hpp>
+#define INCLUDE_BOOST_CONTAINER_SET_HPP <boost/container/set.hpp>
+#define INCLUDE_BOOST_CONTAINER_SLIST_HPP <boost/container/slist.hpp>
+#define INCLUDE_BOOST_CONTAINER_STABLE_VECTOR_HPP <boost/container/stable_vector.hpp>
+#define INCLUDE_BOOST_CONTAINER_STRING_HPP <boost/container/string.hpp>
+#define INCLUDE_BOOST_CONTAINER_VECTOR_HPP <boost/container/vector.hpp>
+//detail
+#define INCLUDE_BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP <boost/container/detail/adaptive_node_pool_impl.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_ADVANCED_INSERT_INT_HPP <boost/container/detail/advanced_insert_int.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_ALGORITHMS_HPP <boost/container/detail/algorithms.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_ALLOCATION_TYPE_HPP <boost/container/detail/allocation_type.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_BEGIN_HPP <boost/container/detail/config_begin.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP <boost/container/detail/config_end.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_DESTROYERS_HPP <boost/container/detail/destroyers.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_FLAT_TREE_HPP <boost/container/detail/flat_tree.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_ITERATORS_HPP <boost/container/detail/iterators.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_MATH_FUNCTIONS_HPP <boost/container/detail/math_functions.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP <boost/container/detail/mpl.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_MULTIALLOCATION_CHAIN_HPP <boost/container/detail/multiallocation_chain.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_NODE_ALLOC_HOLDER_HPP <boost/container/detail/node_alloc_holder.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_NODE_POOL_IMPL_HPP <boost/container/detail/node_pool_impl.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_PAIR_HPP <boost/container/detail/pair.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_POOL_COMMON_HPP <boost/container/detail/pool_common.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP <boost/container/detail/preprocessor.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_TRANSFORM_ITERATOR_HPP <boost/container/detail/transform_iterator.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_TREE_HPP <boost/container/detail/tree.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_TYPE_TRAITS_HPP <boost/container/detail/type_traits.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP <boost/container/detail/utilities.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_VALUE_INIT_HPP <boost/container/detail/value_init.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP <boost/container/detail/variadic_templates_tools.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP <boost/container/detail/version_type.hpp>
+#define INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP <boost/container/detail/workaround.hpp>
+
+#endif //BOOST_CONTAINER_IN_INTERPROCESS
+
 #endif
 
 #ifdef BOOST_MSVC

Modified: branches/release/boost/interprocess/containers/container/detail/destroyers.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/destroyers.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/destroyers.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -17,10 +17,10 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
-#include <boost/interprocess/containers/container/detail/version_type.hpp>
-#include <boost/interprocess/containers/container/detail/utilities.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP
 
 namespace boost {
 namespace container {
@@ -149,6 +149,6 @@
 } //namespace container {
 } //namespace boost {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //#ifndef BOOST_CONTAINERS_DESTROYERS_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/flat_tree.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/flat_tree.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/flat_tree.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -32,23 +32,23 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
 
-#include <boost/interprocess/containers/container/container_fwd.hpp>
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
 
 #include <algorithm>
 #include <functional>
 #include <utility>
 
 #include <boost/type_traits/has_trivial_destructor.hpp>
-#include <boost/interprocess/detail/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 
-#include <boost/interprocess/containers/container/detail/utilities.hpp>
-#include <boost/interprocess/containers/container/detail/pair.hpp>
-#include <boost/interprocess/containers/container/vector.hpp>
-#include <boost/interprocess/containers/container/detail/value_init.hpp>
-#include <boost/interprocess/containers/container/detail/destroyers.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PAIR_HPP
+#include INCLUDE_BOOST_CONTAINER_VECTOR_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_VALUE_INIT_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_DESTROYERS_HPP
 
 namespace boost {
 
@@ -56,37 +56,51 @@
 
 namespace containers_detail {
 
+template<class Compare, class Value, class KeyOfValue>
+class flat_tree_value_compare
+ : private Compare
+{
+ typedef Value first_argument_type;
+ typedef Value second_argument_type;
+ typedef bool return_type;
+ public:
+ flat_tree_value_compare(const Compare &pred)
+ : Compare(pred)
+ {}
+
+ bool operator()(const Value& lhs, const Value& rhs) const
+ {
+ KeyOfValue key_extract;
+ return Compare::operator()(key_extract(lhs), key_extract(rhs));
+ }
+
+ const Compare &get_comp() const
+ { return *this; }
+
+ Compare &get_comp()
+ { return *this; }
+};
+
+template<class Pointer>
+struct get_flat_tree_iterators
+{
+ typedef typename containers_detail::
+ vector_iterator<Pointer> iterator;
+ typedef typename containers_detail::
+ vector_const_iterator<Pointer> const_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+};
+
 template <class Key, class Value, class KeyOfValue,
           class Compare, class Alloc>
 class flat_tree
 {
    typedef boost::container::vector<Value, Alloc> vector_t;
- typedef Alloc allocator_t;
+ typedef Alloc allocator_t;
 
    public:
- class value_compare
- : private Compare
- {
- typedef Value first_argument_type;
- typedef Value second_argument_type;
- typedef bool return_type;
- public:
- value_compare(const Compare &pred)
- : Compare(pred)
- {}
-
- bool operator()(const Value& lhs, const Value& rhs) const
- {
- KeyOfValue key_extract;
- return Compare::operator()(key_extract(lhs), key_extract(rhs));
- }
-
- const Compare &get_comp() const
- { return *this; }
-
- Compare &get_comp()
- { return *this; }
- };
+ typedef flat_tree_value_compare<Compare, Value, KeyOfValue> value_compare;
 
  private:
    struct Data
@@ -94,7 +108,7 @@
       : public value_compare
    {
       private:
- BOOST_COPYABLE_AND_MOVABLE(Data)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(Data)
       public:
       Data(const Data &d)
          : value_compare(d), m_vect(d.m_vect)
@@ -111,17 +125,17 @@
            const allocator_t &alloc)
          : value_compare(comp), m_vect(alloc){}
 
- Data& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(Data) d)
+ Data& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(Data) d)
       {
- value_compare::operator=(d);
+ this->value_compare::operator=(d);
          m_vect = d.m_vect;
          return *this;
       }
 
- Data& operator=(BOOST_INTERPROCESS_RV_REF(Data) d)
+ Data& operator=(BOOST_MOVE_MACRO_RV_REF(Data) d)
       {
- value_compare::operator=(boost::interprocess::move(static_cast<value_compare &>(d)));
- m_vect = boost::interprocess::move(d.m_vect);
+ this->value_compare::operator=(BOOST_CONTAINER_MOVE_NAMESPACE::move(static_cast<value_compare &>(d)));
+ m_vect = BOOST_CONTAINER_MOVE_NAMESPACE::move(d.m_vect);
          return *this;
       }
 
@@ -129,7 +143,7 @@
    };
 
    Data m_data;
- BOOST_COPYABLE_AND_MOVABLE(flat_tree)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(flat_tree)
 
    public:
 
@@ -160,8 +174,8 @@
       : m_data(x.m_data, x.m_data.m_vect)
    { }
 
- flat_tree(BOOST_INTERPROCESS_RV_REF(flat_tree) x)
- : m_data(boost::interprocess::move(x.m_data))
+ flat_tree(BOOST_MOVE_MACRO_RV_REF(flat_tree) x)
+ : m_data(BOOST_CONTAINER_MOVE_NAMESPACE::move(x.m_data))
    { }
 
    template <class InputIterator>
@@ -174,11 +188,11 @@
    ~flat_tree()
    { }
 
- flat_tree& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(flat_tree) x)
+ flat_tree& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(flat_tree) x)
    { m_data = x.m_data; return *this; }
 
- flat_tree& operator=(BOOST_INTERPROCESS_RV_REF(flat_tree) mx)
- { m_data = boost::interprocess::move(mx.m_data); return *this; }
+ flat_tree& operator=(BOOST_MOVE_MACRO_RV_REF(flat_tree) mx)
+ { m_data = BOOST_CONTAINER_MOVE_NAMESPACE::move(mx.m_data); return *this; }
 
    public:
    // accessors:
@@ -261,12 +275,12 @@
       return ret;
    }
 
- std::pair<iterator,bool> insert_unique(BOOST_INTERPROCESS_RV_REF(value_type) val)
+ std::pair<iterator,bool> insert_unique(BOOST_MOVE_MACRO_RV_REF(value_type) val)
    {
       insert_commit_data data;
       std::pair<iterator,bool> ret = priv_insert_unique_prepare(val, data);
       if(ret.second){
- ret.first = priv_insert_commit(data, boost::interprocess::move(val));
+ ret.first = priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move(val));
       }
       return ret;
    }
@@ -279,10 +293,10 @@
       return i;
    }
 
- iterator insert_equal(BOOST_INTERPROCESS_RV_REF(value_type) mval)
+ iterator insert_equal(BOOST_MOVE_MACRO_RV_REF(value_type) mval)
    {
       iterator i = this->upper_bound(KeyOfValue()(mval));
- i = this->m_data.m_vect.insert(i, boost::interprocess::move(mval));
+ i = this->m_data.m_vect.insert(i, BOOST_CONTAINER_MOVE_NAMESPACE::move(mval));
       return i;
    }
 
@@ -296,12 +310,12 @@
       return ret.first;
    }
 
- iterator insert_unique(const_iterator pos, BOOST_INTERPROCESS_RV_REF(value_type) mval)
+ iterator insert_unique(const_iterator pos, BOOST_MOVE_MACRO_RV_REF(value_type) mval)
    {
       insert_commit_data data;
       std::pair<iterator,bool> ret = priv_insert_unique_prepare(pos, mval, data);
       if(ret.second){
- ret.first = priv_insert_commit(data, boost::interprocess::move(mval));
+ ret.first = priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move(mval));
       }
       return ret.first;
    }
@@ -313,11 +327,11 @@
       return priv_insert_commit(data, val);
    }
 
- iterator insert_equal(const_iterator pos, BOOST_INTERPROCESS_RV_REF(value_type) mval)
+ iterator insert_equal(const_iterator pos, BOOST_MOVE_MACRO_RV_REF(value_type) mval)
    {
       insert_commit_data data;
       priv_insert_equal_prepare(pos, mval, data);
- return priv_insert_commit(data, boost::interprocess::move(mval));
+ return priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move(mval));
    }
 
    template <class InIt>
@@ -340,12 +354,12 @@
    template <class... Args>
    iterator emplace_unique(Args&&... args)
    {
- value_type && val = value_type(boost::interprocess::forward<Args>(args)...);
+ value_type && val = value_type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
       insert_commit_data data;
       std::pair<iterator,bool> ret =
          priv_insert_unique_prepare(val, data);
       if(ret.second){
- ret.first = priv_insert_commit(data, boost::interprocess::move<value_type>(val));
+ ret.first = priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move(val));
       }
       return ret.first;
    }
@@ -353,11 +367,11 @@
    template <class... Args>
    iterator emplace_hint_unique(const_iterator hint, Args&&... args)
    {
- value_type && val = value_type(boost::interprocess::forward<Args>(args)...);
+ value_type && val = value_type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
       insert_commit_data data;
       std::pair<iterator,bool> ret = priv_insert_unique_prepare(hint, val, data);
       if(ret.second){
- ret.first = priv_insert_commit(data, boost::interprocess::move<value_type>(val));
+ ret.first = priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move(val));
       }
       return ret.first;
    }
@@ -365,19 +379,19 @@
    template <class... Args>
    iterator emplace_equal(Args&&... args)
    {
- value_type &&val = value_type(boost::interprocess::forward<Args>(args)...);
+ value_type &&val = value_type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
       iterator i = this->upper_bound(KeyOfValue()(val));
- i = this->m_data.m_vect.insert(i, boost::interprocess::move<value_type>(val));
+ i = this->m_data.m_vect.insert(i, BOOST_CONTAINER_MOVE_NAMESPACE::move(val));
       return i;
    }
 
    template <class... Args>
    iterator emplace_hint_equal(const_iterator hint, Args&&... args)
    {
- value_type &&val = value_type(boost::interprocess::forward<Args>(args)...);
+ value_type &&val = value_type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
       insert_commit_data data;
       priv_insert_equal_prepare(hint, val, data);
- return priv_insert_commit(data, boost::interprocess::move<value_type>(val));
+ return priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move(val));
    }
 
    #else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -390,7 +404,7 @@
       std::pair<iterator,bool> ret =
          priv_insert_unique_prepare(val, data);
       if(ret.second){
- ret.first = priv_insert_commit(data, boost::interprocess::move<value_type>(val));
+ ret.first = priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move(val));
       }
       return ret.first;
    }
@@ -402,7 +416,7 @@
       insert_commit_data data;
       std::pair<iterator,bool> ret = priv_insert_unique_prepare(hint, val, data);
       if(ret.second){
- ret.first = priv_insert_commit(data, boost::interprocess::move<value_type>(val));
+ ret.first = priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move(val));
       }
       return ret.first;
    }
@@ -412,7 +426,7 @@
       containers_detail::value_init<value_type> vval;
       value_type &val = vval.m_t;
       iterator i = this->upper_bound(KeyOfValue()(val));
- i = this->m_data.m_vect.insert(i, boost::interprocess::move<value_type>(val));
+ i = this->m_data.m_vect.insert(i, BOOST_CONTAINER_MOVE_NAMESPACE::move(val));
       return i;
    }
 
@@ -422,7 +436,7 @@
       value_type &val = vval.m_t;
       insert_commit_data data;
       priv_insert_equal_prepare(hint, val, data);
- return priv_insert_commit(data, boost::interprocess::move<value_type>(val));
+ return priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move(val));
    }
 
    #define BOOST_PP_LOCAL_MACRO(n) \
@@ -433,7 +447,7 @@
       insert_commit_data data; \
       std::pair<iterator,bool> ret = priv_insert_unique_prepare(val, data); \
       if(ret.second){ \
- ret.first = priv_insert_commit(data, boost::interprocess::move<value_type>(val)); \
+ ret.first = priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move(val)); \
       } \
       return ret.first; \
    } \
@@ -446,7 +460,7 @@
       insert_commit_data data; \
       std::pair<iterator,bool> ret = priv_insert_unique_prepare(hint, val, data); \
       if(ret.second){ \
- ret.first = priv_insert_commit(data, boost::interprocess::move<value_type>(val)); \
+ ret.first = priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move(val)); \
       } \
       return ret.first; \
    } \
@@ -456,7 +470,7 @@
    { \
       value_type val(BOOST_PP_ENUM(n, BOOST_CONTAINERS_PP_PARAM_FORWARD, _)); \
       iterator i = this->upper_bound(KeyOfValue()(val)); \
- i = this->m_data.m_vect.insert(i, boost::interprocess::move<value_type>(val)); \
+ i = this->m_data.m_vect.insert(i, BOOST_CONTAINER_MOVE_NAMESPACE::move(val)); \
       return i; \
    } \
                                                                                           \
@@ -467,7 +481,7 @@
       value_type val(BOOST_PP_ENUM(n, BOOST_CONTAINERS_PP_PARAM_FORWARD, _)); \
       insert_commit_data data; \
       priv_insert_equal_prepare(hint, val, data); \
- return priv_insert_commit(data, boost::interprocess::move<value_type>(val)); \
+ return priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move(val)); \
    } \
    //!
    #define BOOST_PP_LOCAL_LIMITS (1, BOOST_CONTAINERS_MAX_CONSTRUCTOR_PARAMETERS)
@@ -663,11 +677,11 @@
 
    template<class Convertible>
    iterator priv_insert_commit
- (insert_commit_data &commit_data, BOOST_INTERPROCESS_FWD_REF(Convertible) convertible)
+ (insert_commit_data &commit_data, BOOST_MOVE_MACRO_FWD_REF(Convertible) convertible)
    {
       return this->m_data.m_vect.insert
          ( commit_data.position
- , boost::interprocess::forward<Convertible>(convertible));
+ , BOOST_CONTAINER_MOVE_NAMESPACE::forward<Convertible>(convertible));
    }
 
    template <class RanIt>
@@ -856,6 +870,6 @@
 */
 } //namespace boost {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif // BOOST_CONTAINERS_FLAT_TREE_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/iterators.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/iterators.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/iterators.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -18,14 +18,15 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
-#include <boost/interprocess/detail/move.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 
 #ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
-#include <boost/interprocess/containers/container/detail/variadic_templates_tools.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_STORED_REF_HPP
 #else
-#include <boost/interprocess/containers/container/detail/preprocessor.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
 #endif
 
 #include <iterator>
@@ -58,6 +59,16 @@
       return result;
    }
 
+ constant_iterator& operator--()
+ { decrement(); return *this; }
+
+ constant_iterator operator--(int)
+ {
+ constant_iterator result (*this);
+ decrement();
+ return result;
+ }
+
    friend bool operator== (const constant_iterator& i, const constant_iterator& i2)
    { return i.equal(i2); }
 
@@ -102,6 +113,9 @@
    const T& operator*() const
    { return dereference(); }
 
+ const T& operator[] (Difference n) const
+ { return dereference(); }
+
    const T* operator->() const
    { return &(dereference()); }
 
@@ -156,6 +170,16 @@
       return result;
    }
 
+ default_construct_iterator& operator--()
+ { decrement(); return *this; }
+
+ default_construct_iterator operator--(int)
+ {
+ default_construct_iterator result (*this);
+ decrement();
+ return result;
+ }
+
    friend bool operator== (const default_construct_iterator& i, const default_construct_iterator& i2)
    { return i.equal(i2); }
 
@@ -203,6 +227,9 @@
    const T* operator->() const
    { return &(dereference()); }
 
+ const T& operator[] (Difference n) const
+ { return dereference(); }
+
    private:
    Difference m_num;
 
@@ -255,6 +282,16 @@
       return result;
    }
 
+ this_type& operator--()
+ { increment(); return *this; }
+
+ this_type operator--(int)
+ {
+ this_type result (*this);
+ increment();
+ return result;
+ }
+
    friend bool operator== (const this_type& i, const this_type& i2)
    { return i.equal(i2); }
 
@@ -299,6 +336,9 @@
    T& operator*() const
    { return dereference(); }
 
+ T& operator[] (Difference n) const
+ { return dereference(); }
+
    T *operator->() const
    { return &(dereference()); }
 
@@ -352,6 +392,16 @@
       return result;
    }
 
+ this_type& operator--()
+ { decrement(); return *this; }
+
+ this_type operator--(int)
+ {
+ this_type result (*this);
+ decrement();
+ return result;
+ }
+
    friend bool operator== (const this_type& i, const this_type& i2)
    { return i.equal(i2); }
 
@@ -396,6 +446,9 @@
    const T& operator*() const
    { return dereference(); }
 
+ const T& operator[](std::ptrdiff_t) const
+ { return dereference(); }
+
    const T* operator->() const
    { return &(dereference()); }
 
@@ -447,9 +500,9 @@
 
    template<int ...IdxPack>
    void inplace_impl(T* ptr, const containers_detail::index_tuple<IdxPack...>&)
- { ::new(ptr) T(boost::interprocess::forward<Args>(containers_detail::get<IdxPack>(args_))...); }
+ { ::new(ptr) T(containers_detail::stored_ref<Args>::forward(containers_detail::get<IdxPack>(args_))...); }
 
- containers_detail::tuple<Args&&...> args_;
+ containers_detail::tuple<Args&...> args_;
 };
 
 #else
@@ -486,7 +539,7 @@
 } //namespace container {
 } //namespace boost {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //#ifndef BOOST_CONTAINERS_DETAIL_ITERATORS_HPP
 

Modified: branches/release/boost/interprocess/containers/container/detail/multiallocation_chain.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/multiallocation_chain.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/multiallocation_chain.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -11,14 +11,14 @@
 #ifndef BOOST_CONTAINERS_DETAIL_MULTIALLOCATION_CHAIN_HPP
 #define BOOST_CONTAINERS_DETAIL_MULTIALLOCATION_CHAIN_HPP
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/container_fwd.hpp>
-#include <boost/interprocess/containers/container/detail/utilities.hpp>
-#include <boost/interprocess/containers/container/detail/type_traits.hpp>
-#include <boost/interprocess/containers/container/detail/transform_iterator.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_TYPE_TRAITS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_TRANSFORM_ITERATOR_HPP
 #include <boost/intrusive/slist.hpp>
 #include <boost/pointer_to_other.hpp>
-#include <boost/interprocess/detail/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 
 namespace boost {
 namespace container {
@@ -41,7 +41,7 @@
    static node & to_node(VoidPointer p)
    { return *static_cast<node*>(static_cast<void*>(containers_detail::get_pointer(p))); }
 
- BOOST_INTERPROCESS_MOVABLE_BUT_NOT_COPYABLE(basic_multiallocation_chain)
+ BOOST_MOVE_MACRO_MOVABLE_BUT_NOT_COPYABLE(basic_multiallocation_chain)
 
    public:
 
@@ -53,13 +53,13 @@
       : slist_impl_()
    {}
 
- basic_multiallocation_chain(BOOST_INTERPROCESS_RV_REF(basic_multiallocation_chain) other)
+ basic_multiallocation_chain(BOOST_MOVE_MACRO_RV_REF(basic_multiallocation_chain) other)
       : slist_impl_()
    { slist_impl_.swap(other.slist_impl_); }
 
- basic_multiallocation_chain& operator=(BOOST_INTERPROCESS_RV_REF(basic_multiallocation_chain) other)
+ basic_multiallocation_chain& operator=(BOOST_MOVE_MACRO_RV_REF(basic_multiallocation_chain) other)
    {
- basic_multiallocation_chain tmp(boost::interprocess::move(other));
+ basic_multiallocation_chain tmp(BOOST_CONTAINER_MOVE_NAMESPACE::move(other));
       this->swap(tmp);
       return *this;
    }
@@ -144,7 +144,7 @@
 class transform_multiallocation_chain
 {
    private:
- BOOST_INTERPROCESS_MOVABLE_BUT_NOT_COPYABLE(transform_multiallocation_chain)
+ BOOST_MOVE_MACRO_MOVABLE_BUT_NOT_COPYABLE(transform_multiallocation_chain)
 
    MultiallocationChain holder_;
    typedef typename MultiallocationChain::void_pointer void_pointer;
@@ -165,17 +165,17 @@
       : holder_()
    {}
 
- transform_multiallocation_chain(BOOST_INTERPROCESS_RV_REF(transform_multiallocation_chain) other)
+ transform_multiallocation_chain(BOOST_MOVE_MACRO_RV_REF(transform_multiallocation_chain) other)
       : holder_()
    { this->swap(other); }
 
- transform_multiallocation_chain(BOOST_INTERPROCESS_RV_REF(MultiallocationChain) other)
- : holder_(boost::interprocess::move(other))
+ transform_multiallocation_chain(BOOST_MOVE_MACRO_RV_REF(MultiallocationChain) other)
+ : holder_(BOOST_CONTAINER_MOVE_NAMESPACE::move(other))
    {}
 
- transform_multiallocation_chain& operator=(BOOST_INTERPROCESS_RV_REF(transform_multiallocation_chain) other)
+ transform_multiallocation_chain& operator=(BOOST_MOVE_MACRO_RV_REF(transform_multiallocation_chain) other)
    {
- transform_multiallocation_chain tmp(boost::interprocess::move(other));
+ transform_multiallocation_chain tmp(BOOST_CONTAINER_MOVE_NAMESPACE::move(other));
       this->swap(tmp);
       return *this;
    }
@@ -230,7 +230,7 @@
 
    MultiallocationChain extract_multiallocation_chain()
    {
- return MultiallocationChain(boost::interprocess::move(holder_));
+ return MultiallocationChain(BOOST_CONTAINER_MOVE_NAMESPACE::move(holder_));
    }
 };
 
@@ -240,6 +240,6 @@
 // namespace container {
 // namespace boost {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //BOOST_CONTAINERS_DETAIL_MULTIALLOCATION_CHAIN_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/node_alloc_holder.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/node_alloc_holder.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/node_alloc_holder.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -15,26 +15,26 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
 
 #include <utility>
 #include <functional>
 
-#include <boost/interprocess/detail/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 #include <boost/intrusive/options.hpp>
 
-#include <boost/interprocess/containers/container/detail/version_type.hpp>
-#include <boost/interprocess/containers/container/detail/type_traits.hpp>
-#include <boost/interprocess/containers/container/detail/utilities.hpp>
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
-#include <boost/interprocess/containers/container/detail/destroyers.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_TYPE_TRAITS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_DESTROYERS_HPP
 
 #ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
-#include <boost/interprocess/containers/container/detail/preprocessor.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
 #endif
 
-#include <boost/interprocess/containers/container/detail/algorithms.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ALGORITHMS_HPP
 
 
 namespace boost {
@@ -60,7 +60,7 @@
    void priv_deallocate(allocator_v2)
    { m_alloc.deallocate_one(m_ptr); }
 
- BOOST_INTERPROCESS_MOVABLE_BUT_NOT_COPYABLE(scoped_deallocator)
+ BOOST_MOVE_MACRO_MOVABLE_BUT_NOT_COPYABLE(scoped_deallocator)
 
    public:
 
@@ -74,7 +74,7 @@
    ~scoped_deallocator()
    { if (m_ptr)priv_deallocate(alloc_version()); }
 
- scoped_deallocator(BOOST_INTERPROCESS_RV_REF(scoped_deallocator) o)
+ scoped_deallocator(BOOST_MOVE_MACRO_RV_REF(scoped_deallocator) o)
       : m_ptr(o.m_ptr), m_alloc(o.m_alloc)
    { o.release(); }
 
@@ -128,7 +128,7 @@
    ~allocator_multialloc_chain_node_deallocator()
    {
       if(!c_.empty())
- a_.deallocate_individual(boost::interprocess::move(c_));
+ a_.deallocate_individual(BOOST_CONTAINER_MOVE_NAMESPACE::move(c_));
    }
 };
 
@@ -177,7 +177,7 @@
    typedef allocator_destroyer<NodeAlloc> Destroyer;
 
    private:
- BOOST_COPYABLE_AND_MOVABLE(node_alloc_holder)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(node_alloc_holder)
 
    public:
 
@@ -189,14 +189,14 @@
       : members_(other.node_alloc())
    {}
 
- node_alloc_holder(BOOST_INTERPROCESS_RV_REF(node_alloc_holder) other)
- : members_(boost::interprocess::move(other.node_alloc()))
+ node_alloc_holder(BOOST_MOVE_MACRO_RV_REF(node_alloc_holder) other)
+ : members_(BOOST_CONTAINER_MOVE_NAMESPACE::move(other.node_alloc()))
    { this->swap(other); }
 
- node_alloc_holder & operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(node_alloc_holder) other)
+ node_alloc_holder & operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(node_alloc_holder) other)
    { members_.assign(other.node_alloc()); }
 
- node_alloc_holder & operator=(BOOST_INTERPROCESS_RV_REF(node_alloc_holder) other)
+ node_alloc_holder & operator=(BOOST_MOVE_MACRO_RV_REF(node_alloc_holder) other)
    { members_.assign(other.node_alloc()); }
 
    template<class Pred>
@@ -205,7 +205,7 @@
    {}
 
    template<class Pred>
- node_alloc_holder(BOOST_INTERPROCESS_RV_REF(ValAlloc) a, const Pred &c)
+ node_alloc_holder(BOOST_MOVE_MACRO_RV_REF(ValAlloc) a, const Pred &c)
       : members_(a, typename ICont::value_compare(c))
    {}
 
@@ -240,7 +240,7 @@
 
    template<class Convertible1, class Convertible2>
    static void construct(const NodePtr &ptr,
- BOOST_INTERPROCESS_RV_REF_2_TEMPL_ARGS(std::pair, Convertible1, Convertible2) value)
+ BOOST_MOVE_MACRO_RV_REF_2_TEMPL_ARGS(std::pair, Convertible1, Convertible2) value)
    {
       typedef typename Node::hook_type hook_type;
       typedef typename Node::value_type::first_type first_type;
@@ -251,9 +251,9 @@
       new(static_cast<hook_type*>(nodeptr))hook_type();
       //Now construct pair members_holder
       value_type *valueptr = &nodeptr->get_data();
- new((void*)&valueptr->first) first_type(boost::interprocess::move(value.first));
+ new((void*)&valueptr->first) first_type(BOOST_CONTAINER_MOVE_NAMESPACE::move(value.first));
       BOOST_TRY{
- new((void*)&valueptr->second) second_type(boost::interprocess::move(value.second));
+ new((void*)&valueptr->second) second_type(BOOST_CONTAINER_MOVE_NAMESPACE::move(value.second));
       }
       BOOST_CATCH(...){
          valueptr->first.~first_type();
@@ -275,14 +275,14 @@
 
    template<class ...Args>
    static void construct(const NodePtr &ptr, Args &&...args)
- { new((void*)containers_detail::get_pointer(ptr)) Node(boost::interprocess::forward<Args>(args)...); }
+ { new((void*)containers_detail::get_pointer(ptr)) Node(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    template<class ...Args>
    NodePtr create_node(Args &&...args)
    {
       NodePtr p = this->allocate_one();
       Deallocator node_deallocator(p, this->node_alloc());
- self_t::construct(p, boost::interprocess::forward<Args>(args)...);
+ self_t::construct(p, BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
       node_deallocator.release();
       return (p);
    }
@@ -383,7 +383,7 @@
             if(constructed){
                this->destroy(p);
             }
- this->node_alloc().deallocate_individual(boost::interprocess::move(mem));
+ this->node_alloc().deallocate_individual(BOOST_CONTAINER_MOVE_NAMESPACE::move(mem));
             BOOST_RETHROW
          }
          BOOST_CATCH_END
@@ -399,9 +399,9 @@
       typename NodeAlloc::multiallocation_chain chain;
       allocator_destroyer_and_chain_builder<NodeAlloc> builder(this->node_alloc(), chain);
       this->icont().clear_and_dispose(builder);
- BOOST_STATIC_ASSERT((::boost::interprocess::is_movable<typename NodeAlloc::multiallocation_chain>::value == true));
+ BOOST_STATIC_ASSERT((::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<typename NodeAlloc::multiallocation_chain>::value == true));
       if(!chain.empty())
- this->node_alloc().deallocate_individual(boost::interprocess::move(chain));
+ this->node_alloc().deallocate_individual(BOOST_CONTAINER_MOVE_NAMESPACE::move(chain));
    }
 
    icont_iterator erase_range(icont_iterator first, icont_iterator last, allocator_v1)
@@ -496,6 +496,6 @@
 } //namespace container {
 } //namespace boost {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif // BOOST_CONTAINERS_DETAIL_NODE_ALLOC_HPP_

Modified: branches/release/boost/interprocess/containers/container/detail/node_pool_impl.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/node_pool_impl.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/node_pool_impl.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -15,18 +15,18 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/container_fwd.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
-#include <boost/interprocess/containers/container/detail/utilities.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP
 #include <boost/pointer_to_other.hpp>
 #include <boost/intrusive/set.hpp>
 #include <boost/intrusive/slist.hpp>
-#include <boost/interprocess/containers/container/detail/type_traits.hpp>
-#include <boost/interprocess/containers/container/detail/math_functions.hpp>
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
-#include <boost/interprocess/containers/container/detail/pool_common.hpp>
-#include <cassert>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_TYPE_TRAITS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MATH_FUNCTIONS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_POOL_COMMON_HPP
+#include <boost/assert.hpp>
 #include <cstddef>
 #include <functional> //std::unary_function
 
@@ -120,7 +120,7 @@
       multiallocation_chain chain;
       chain.incorporate_after(chain.before_begin(), &*first_node, &*last_node, n);
       m_allocated += n;
- return boost::interprocess::move(chain);
+ return BOOST_CONTAINER_MOVE_NAMESPACE::move(chain);
    }
 
    void deallocate_nodes(multiallocation_chain chain)
@@ -185,7 +185,7 @@
          }
       }
       //We should have removed all the nodes from the free list
- assert(m_freelist.empty());
+ BOOST_ASSERT(m_freelist.empty());
 
       //Now pass all the node to the free list again
       m_freelist.splice_after
@@ -204,7 +204,7 @@
    void purge_blocks()
    {
       //check for memory leaks
- assert(m_allocated==0);
+ BOOST_ASSERT(m_allocated==0);
       std::size_t blocksize = get_rounded_size
          (m_real_node_size*m_nodes_per_block, alignment_of<node_t>::value);
       typename blockslist_t::iterator
@@ -222,8 +222,8 @@
 
    void swap(private_node_pool_impl &other)
    {
- assert(m_nodes_per_block == other.m_nodes_per_block);
- assert(m_real_node_size == other.m_real_node_size);
+ BOOST_ASSERT(m_nodes_per_block == other.m_nodes_per_block);
+ BOOST_ASSERT(m_real_node_size == other.m_real_node_size);
       std::swap(mp_segment_mngr_base, other.mp_segment_mngr_base);
       m_blocklist.swap(other.m_blocklist);
       m_freelist.swap(other.m_freelist);
@@ -289,7 +289,7 @@
       //We put the node at the beginning of the free node list
       node_t * to_deallocate = static_cast<node_t*>(pElem);
       m_freelist.push_front(*to_deallocate);
- assert(m_allocated>0);
+ BOOST_ASSERT(m_allocated>0);
       --m_allocated;
    }
 
@@ -361,6 +361,6 @@
 } //namespace container {
 } //namespace boost {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //#ifndef BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/pair.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/pair.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/pair.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -17,18 +17,18 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
 
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
-#include <boost/interprocess/containers/container/detail/type_traits.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_TYPE_TRAITS_HPP
 
 #include <utility> //std::pair
 
-#include <boost/interprocess/detail/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 
 #ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
-#include <boost/interprocess/containers/container/detail/preprocessor.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
 #endif
 
 namespace boost {
@@ -39,7 +39,7 @@
 struct pair
 {
    private:
- BOOST_COPYABLE_AND_MOVABLE(pair)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(pair)
 
    public:
    typedef T1 first_type;
@@ -61,8 +61,8 @@
    {}
 
    template <class D, class S>
- pair(BOOST_INTERPROCESS_RV_REF_2_TEMPL_ARGS(std::pair, D, S) p)
- : first(boost::interprocess::move(p.first)), second(boost::interprocess::move(p.second))
+ pair(BOOST_MOVE_MACRO_RV_REF_2_TEMPL_ARGS(std::pair, D, S) p)
+ : first(BOOST_CONTAINER_MOVE_NAMESPACE::move(p.first)), second(BOOST_CONTAINER_MOVE_NAMESPACE::move(p.second))
    {}
 
    pair()
@@ -79,40 +79,40 @@
       : first(x.first), second(x.second)
    {}
 
- pair(BOOST_INTERPROCESS_RV_REF(pair) p)
- : first(boost::interprocess::move(p.first)), second(boost::interprocess::move(p.second))
+ pair(BOOST_MOVE_MACRO_RV_REF(pair) p)
+ : first(BOOST_CONTAINER_MOVE_NAMESPACE::move(p.first)), second(BOOST_CONTAINER_MOVE_NAMESPACE::move(p.second))
    {}
 
    template <class D, class S>
- pair(BOOST_INTERPROCESS_RV_REF_2_TEMPL_ARGS(pair, D, S) p)
- : first(boost::interprocess::move(p.first)), second(boost::interprocess::move(p.second))
+ pair(BOOST_MOVE_MACRO_RV_REF_2_TEMPL_ARGS(pair, D, S) p)
+ : first(BOOST_CONTAINER_MOVE_NAMESPACE::move(p.first)), second(BOOST_CONTAINER_MOVE_NAMESPACE::move(p.second))
    {}
 
    #ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
 
    template<class U, class ...Args>
    pair(U &&u, Args &&... args)
- : first(boost::interprocess::forward<U>(u))
- , second(boost::interprocess::forward<Args>(args)...)
+ : first(BOOST_CONTAINER_MOVE_NAMESPACE::forward<U>(u))
+ , second(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...)
    {}
 
    #else
 
    template<class U>
    pair( BOOST_CONTAINERS_PARAM(U, u)
- #ifndef BOOST_HAS_RVALUE_REFS
+ #ifdef BOOST_NO_RVALUE_REFERENCES
        , typename containers_detail::disable_if
- < containers_detail::is_same<U, ::boost::interprocess::rv<pair> > >::type* = 0
+ < containers_detail::is_same<U, ::BOOST_CONTAINER_MOVE_NAMESPACE::rv<pair> > >::type* = 0
        #endif
       )
- : first(boost::interprocess::forward<U>(const_cast<U&>(u)))
+ : first(BOOST_CONTAINER_MOVE_NAMESPACE::forward<U>(const_cast<U&>(u)))
    {}
 
    #define BOOST_PP_LOCAL_MACRO(n) \
    template<class U, BOOST_PP_ENUM_PARAMS(n, class P)> \
    pair(BOOST_CONTAINERS_PARAM(U, u) \
        ,BOOST_PP_ENUM(n, BOOST_CONTAINERS_PP_PARAM_LIST, _)) \
- : first(boost::interprocess::forward<U>(const_cast<U&>(u))) \
+ : first(BOOST_CONTAINER_MOVE_NAMESPACE::forward<U>(const_cast<U&>(u))) \
       , second(BOOST_PP_ENUM(n, BOOST_CONTAINERS_PP_PARAM_FORWARD, _)) \
    {} \
    //!
@@ -120,32 +120,32 @@
    #include BOOST_PP_LOCAL_ITERATE()
    #endif
 
- pair& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(pair) p)
+ pair& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(pair) p)
    {
       first = p.first;
       second = p.second;
       return *this;
    }
 
- pair& operator=(BOOST_INTERPROCESS_RV_REF(pair) p)
+ pair& operator=(BOOST_MOVE_MACRO_RV_REF(pair) p)
    {
- first = boost::interprocess::move(p.first);
- second = boost::interprocess::move(p.second);
+ first = BOOST_CONTAINER_MOVE_NAMESPACE::move(p.first);
+ second = BOOST_CONTAINER_MOVE_NAMESPACE::move(p.second);
       return *this;
    }
 
- pair& operator=(BOOST_INTERPROCESS_RV_REF_2_TEMPL_ARGS(std::pair, T1, T2) p)
+ pair& operator=(BOOST_MOVE_MACRO_RV_REF_2_TEMPL_ARGS(std::pair, T1, T2) p)
    {
- first = boost::interprocess::move(p.first);
- second = boost::interprocess::move(p.second);
+ first = BOOST_CONTAINER_MOVE_NAMESPACE::move(p.first);
+ second = BOOST_CONTAINER_MOVE_NAMESPACE::move(p.second);
       return *this;
    }
 
    template <class D, class S>
- pair& operator=(BOOST_INTERPROCESS_RV_REF_2_TEMPL_ARGS(std::pair, D, S) p)
+ pair& operator=(BOOST_MOVE_MACRO_RV_REF_2_TEMPL_ARGS(std::pair, D, S) p)
    {
- first = boost::interprocess::move(p.first);
- second = boost::interprocess::move(p.second);
+ first = BOOST_CONTAINER_MOVE_NAMESPACE::move(p.first);
+ second = BOOST_CONTAINER_MOVE_NAMESPACE::move(p.second);
       return *this;
    }
 
@@ -192,8 +192,21 @@
 } //namespace containers_detail {
 } //namespace container {
 
+
+//Without this specialization recursive flat_(multi)map instantiation fails
+//because is_enum needs to instantiate the recursive pair, leading to a compilation error).
+//This breaks the cycle clearly stating that pair is not an enum avoiding any instantiation.
+template<class T>
+struct is_enum;
+
+template<class T, class U>
+struct is_enum< ::boost::container::containers_detail::pair<T, U> >
+{
+ static const bool value = false;
+};
+
 } //namespace boost {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //#ifndef BOOST_CONTAINERS_DETAIL_PAIR_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/pool_common.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/pool_common.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/pool_common.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -15,7 +15,7 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
+#include "config_begin.hpp"
 #include <boost/intrusive/slist.hpp>
 #include <new>
 
@@ -47,6 +47,6 @@
 } //namespace container {
 } //namespace boost {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //#ifndef BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/preprocessor.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/preprocessor.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/preprocessor.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -15,8 +15,13 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
+#include "config_begin.hpp"
+
+#ifndef BOOST_NO_RVALUE_REFERENCES
+#include INCLUDE_BOOST_CONTAINER_DETAIL_STORED_REF_HPP
+#endif
+
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
 
 #ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
 #error "This file is not needed when perfect forwarding is available"
@@ -36,7 +41,7 @@
 //This cast is ugly but it is necessary until "perfect forwarding"
 //is achieved in C++0x. Meanwhile, if we want to be able to
 //bind rvalues with non-const references, we have to be ugly
-#ifdef BOOST_HAS_RVALUE_REFS
+#ifndef BOOST_NO_RVALUE_REFERENCES
    #define BOOST_CONTAINERS_PP_PARAM_LIST(z, n, data) \
    BOOST_PP_CAT(P, n) && BOOST_PP_CAT(p, n) \
    //!
@@ -46,7 +51,7 @@
    //!
 #endif
 
-#ifdef BOOST_HAS_RVALUE_REFS
+#ifndef BOOST_NO_RVALUE_REFERENCES
    #define BOOST_CONTAINERS_PARAM(U, u) \
    U && u \
    //!
@@ -56,10 +61,22 @@
    //!
 #endif
 
-#ifdef BOOST_HAS_RVALUE_REFS
+#ifndef BOOST_NO_RVALUE_REFERENCES
+
+#ifdef BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
+
 #define BOOST_CONTAINERS_AUX_PARAM_INIT(z, n, data) \
- BOOST_PP_CAT(m_p, n) (BOOST_PP_CAT(p, n)) \
+ BOOST_PP_CAT(m_p, n) (BOOST_CONTAINER_MOVE_NAMESPACE::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) )) \
 //!
+
+#else
+
+#define BOOST_CONTAINERS_AUX_PARAM_INIT(z, n, data) \
+ BOOST_PP_CAT(m_p, n) (static_cast<BOOST_PP_CAT(P, n)>( BOOST_PP_CAT(p, n) )) \
+//!
+
+#endif
+
 #else
 #define BOOST_CONTAINERS_AUX_PARAM_INIT(z, n, data) \
   BOOST_PP_CAT(m_p, n) (const_cast<BOOST_PP_CAT(P, n) &>(BOOST_PP_CAT(p, n))) \
@@ -70,10 +87,23 @@
   BOOST_PP_CAT(++m_p, n) \
 //!
 
-#ifdef BOOST_HAS_RVALUE_REFS
+#ifndef BOOST_NO_RVALUE_REFERENCES
+
+#if defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
+
+#define BOOST_CONTAINERS_AUX_PARAM_DEFINE(z, n, data) \
+ BOOST_PP_CAT(P, n) & BOOST_PP_CAT(m_p, n); \
+//!
+
+#else
+
 #define BOOST_CONTAINERS_AUX_PARAM_DEFINE(z, n, data) \
   BOOST_PP_CAT(P, n) && BOOST_PP_CAT(m_p, n); \
 //!
+
+#endif //defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
+
+
 #else
 #define BOOST_CONTAINERS_AUX_PARAM_DEFINE(z, n, data) \
   BOOST_PP_CAT(P, n) & BOOST_PP_CAT(m_p, n); \
@@ -81,18 +111,28 @@
 #endif
 
 #define BOOST_CONTAINERS_PP_PARAM_FORWARD(z, n, data) \
-boost::interprocess::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) ) \
+BOOST_CONTAINER_MOVE_NAMESPACE::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) ) \
 //!
 
+#if !defined(BOOST_NO_RVALUE_REFERENCES) && defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
+
 #define BOOST_CONTAINERS_PP_MEMBER_FORWARD(z, n, data) \
-boost::interprocess::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(m_p, n) ) \
+::boost::container::containers_detail::stored_ref< BOOST_PP_CAT(P, n) >::forward( BOOST_PP_CAT(m_p, n) ) \
 //!
 
+#else
+
+#define BOOST_CONTAINERS_PP_MEMBER_FORWARD(z, n, data) \
+BOOST_CONTAINER_MOVE_NAMESPACE::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(m_p, n) ) \
+//!
+
+#endif //!defined(BOOST_NO_RVALUE_REFERENCES) && defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
+
 #define BOOST_CONTAINERS_PP_MEMBER_IT_FORWARD(z, n, data) \
 BOOST_PP_CAT(*m_p, n) \
 //!
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #else
 #ifdef BOOST_CONTAINERS_PERFECT_FORWARDING

Modified: branches/release/boost/interprocess/containers/container/detail/transform_iterator.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/transform_iterator.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/transform_iterator.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -18,9 +18,9 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
-#include <boost/interprocess/containers/container/detail/type_traits.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_TYPE_TRAITS_HPP
 #include <iterator>
 
 namespace boost {
@@ -47,7 +47,7 @@
       : m_value(px)
    {}
 
- T* operator->() const { return &m_value; }
+ T* operator->() const { return const_cast<T*>(&m_value); }
    // This function is needed for MWCW and BCC, which won't call operator->
    // again automatically per 13.3.1.2 para 8
 // operator T*() const { return &m_value; }
@@ -171,6 +171,6 @@
 } //namespace container {
 } //namespace boost {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //#ifndef BOOST_CONTAINERS_DETAIL_TRANSFORM_ITERATORS_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/tree.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/tree.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/tree.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -7,58 +7,27 @@
 // See http://www.boost.org/libs/container for documentation.
 //
 //////////////////////////////////////////////////////////////////////////////
-//
-// This file comes from SGI's stl_tree file. Modified by Ion Gaztanaga 2005.
-// Renaming, isolating and porting to generic algorithms. Pointer typedef
-// set to allocator::pointer to allow placing it in shared memory.
-//
-///////////////////////////////////////////////////////////////////////////////
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
+
 #ifndef BOOST_CONTAINERS_TREE_HPP
 #define BOOST_CONTAINERS_TREE_HPP
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
-#include <boost/interprocess/containers/container/container_fwd.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
 
-#include <boost/interprocess/detail/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 #include <boost/pointer_to_other.hpp>
 #include <boost/type_traits/has_trivial_destructor.hpp>
 #include <boost/detail/no_exceptions_support.hpp>
 #include <boost/intrusive/rbtree.hpp>
 
-#include <boost/interprocess/containers/container/detail/utilities.hpp>
-#include <boost/interprocess/containers/container/detail/algorithms.hpp>
-#include <boost/interprocess/containers/container/detail/node_alloc_holder.hpp>
-#include <boost/interprocess/containers/container/detail/destroyers.hpp>
-#include <boost/interprocess/containers/container/detail/pair.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ALGORITHMS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_NODE_ALLOC_HOLDER_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_DESTROYERS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PAIR_HPP
 #ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
-#include <boost/interprocess/containers/container/detail/preprocessor.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
 #endif
 
 #include <utility> //std::pair
@@ -153,7 +122,7 @@
 
    template<class ...Args>
    rbtree_node(Args &&...args)
- : m_data(boost::interprocess::forward<Args>(args)...)
+ : m_data(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...)
    {}
    #endif//#ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
 
@@ -195,12 +164,12 @@
 
    public:
    template<class Convertible>
- static void construct(node_type *ptr, BOOST_INTERPROCESS_FWD_REF(Convertible) convertible)
- { new(ptr) node_type(boost::interprocess::forward<Convertible>(convertible)); }
+ static void construct(node_type *ptr, BOOST_MOVE_MACRO_FWD_REF(Convertible) convertible)
+ { new(ptr) node_type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Convertible>(convertible)); }
 };
 
 }//namespace containers_detail {
-#if !defined(BOOST_HAS_RVALUE_REFS)
+#if defined(BOOST_NO_RVALUE_REFERENCES)
 template<class T, class VoidPointer>
 struct has_own_construct_from_it
    < boost::container::containers_detail::rbtree_node<T, VoidPointer> >
@@ -298,7 +267,7 @@
       AllocHolder &m_holder;
       Icont &m_icont;
    };
- BOOST_COPYABLE_AND_MOVABLE(rbtree)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(rbtree)
 
    public:
 
@@ -468,14 +437,14 @@
          (x.icont(), typename AllocHolder::cloner(*this), Destroyer(this->node_alloc()));
    }
 
- rbtree(BOOST_INTERPROCESS_RV_REF(rbtree) x)
+ rbtree(BOOST_MOVE_MACRO_RV_REF(rbtree) x)
       : AllocHolder(x, x.key_comp())
    { this->swap(x); }
 
    ~rbtree()
    {} //AllocHolder clears the tree
 
- rbtree& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(rbtree) x)
+ rbtree& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(rbtree) x)
    {
       if (this != &x) {
          //Transfer all the nodes to a temporary tree
@@ -500,7 +469,7 @@
       return *this;
    }
 
- rbtree& operator=(BOOST_INTERPROCESS_RV_REF(rbtree) mx)
+ rbtree& operator=(BOOST_MOVE_MACRO_RV_REF(rbtree) mx)
    { this->clear(); this->swap(mx); return *this; }
 
    public:
@@ -620,9 +589,9 @@
 
    template<class MovableConvertible>
    iterator insert_unique_commit
- (BOOST_INTERPROCESS_FWD_REF(MovableConvertible) mv, insert_commit_data &data)
+ (BOOST_MOVE_MACRO_FWD_REF(MovableConvertible) mv, insert_commit_data &data)
    {
- NodePtr tmp = AllocHolder::create_node(boost::interprocess::forward<MovableConvertible>(mv));
+ NodePtr tmp = AllocHolder::create_node(BOOST_CONTAINER_MOVE_NAMESPACE::forward<MovableConvertible>(mv));
       iiterator it(this->icont().insert_unique_commit(*tmp, data));
       return iterator(it);
    }
@@ -639,7 +608,7 @@
    }
 
    template<class MovableConvertible>
- std::pair<iterator,bool> insert_unique(BOOST_INTERPROCESS_FWD_REF(MovableConvertible) mv)
+ std::pair<iterator,bool> insert_unique(BOOST_MOVE_MACRO_FWD_REF(MovableConvertible) mv)
    {
       insert_commit_data data;
       std::pair<iterator,bool> ret =
@@ -647,7 +616,7 @@
       if(!ret.second)
          return ret;
       return std::pair<iterator,bool>
- (this->insert_unique_commit(boost::interprocess::forward<MovableConvertible>(mv), data), true);
+ (this->insert_unique_commit(BOOST_CONTAINER_MOVE_NAMESPACE::forward<MovableConvertible>(mv), data), true);
    }
 
    private:
@@ -683,23 +652,23 @@
 
    template <class... Args>
    iterator emplace_unique(Args&&... args)
- { return this->emplace_unique_impl(AllocHolder::create_node(boost::interprocess::forward<Args>(args)...)); }
+ { return this->emplace_unique_impl(AllocHolder::create_node(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...)); }
 
    template <class... Args>
    iterator emplace_hint_unique(const_iterator hint, Args&&... args)
- { return this->emplace_unique_hint_impl(hint, AllocHolder::create_node(boost::interprocess::forward<Args>(args)...)); }
+ { return this->emplace_unique_hint_impl(hint, AllocHolder::create_node(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...)); }
 
    template <class... Args>
    iterator emplace_equal(Args&&... args)
    {
- NodePtr p(AllocHolder::create_node(boost::interprocess::forward<Args>(args)...));
+ NodePtr p(AllocHolder::create_node(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...));
       return iterator(this->icont().insert_equal(this->icont().end(), *p));
    }
 
    template <class... Args>
    iterator emplace_hint_equal(const_iterator hint, Args&&... args)
    {
- NodePtr p(AllocHolder::create_node(boost::interprocess::forward<Args>(args)...));
+ NodePtr p(AllocHolder::create_node(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...));
       return iterator(this->icont().insert_equal(hint.get(), *p));
    }
 
@@ -768,14 +737,14 @@
    }
 
    template<class MovableConvertible>
- iterator insert_unique(const_iterator hint, BOOST_INTERPROCESS_FWD_REF(MovableConvertible) mv)
+ iterator insert_unique(const_iterator hint, BOOST_MOVE_MACRO_FWD_REF(MovableConvertible) mv)
    {
       insert_commit_data data;
       std::pair<iterator,bool> ret =
          this->insert_unique_check(hint, KeyOfValue()(mv), data);
       if(!ret.second)
          return ret.first;
- return this->insert_unique_commit(boost::interprocess::forward<MovableConvertible>(mv), data);
+ return this->insert_unique_commit(BOOST_CONTAINER_MOVE_NAMESPACE::forward<MovableConvertible>(mv), data);
    }
 
    template <class InputIterator>
@@ -801,9 +770,9 @@
    }
 
    template<class MovableConvertible>
- iterator insert_equal(BOOST_INTERPROCESS_FWD_REF(MovableConvertible) mv)
+ iterator insert_equal(BOOST_MOVE_MACRO_FWD_REF(MovableConvertible) mv)
    {
- NodePtr p(AllocHolder::create_node(boost::interprocess::forward<MovableConvertible>(mv)));
+ NodePtr p(AllocHolder::create_node(BOOST_CONTAINER_MOVE_NAMESPACE::forward<MovableConvertible>(mv)));
       return iterator(this->icont().insert_equal(this->icont().end(), *p));
    }
 
@@ -814,9 +783,9 @@
    }
 
    template<class MovableConvertible>
- iterator insert_equal(const_iterator hint, BOOST_INTERPROCESS_FWD_REF(MovableConvertible) mv)
+ iterator insert_equal(const_iterator hint, BOOST_MOVE_MACRO_FWD_REF(MovableConvertible) mv)
    {
- NodePtr p(AllocHolder::create_node(boost::interprocess::forward<MovableConvertible>(mv)));
+ NodePtr p(AllocHolder::create_node(BOOST_CONTAINER_MOVE_NAMESPACE::forward<MovableConvertible>(mv)));
       return iterator(this->icont().insert_equal(hint.get(), *p));
    }
 
@@ -1061,6 +1030,6 @@
 */
 } //namespace boost {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //BOOST_CONTAINERS_TREE_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/type_traits.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/type_traits.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/type_traits.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -19,7 +19,7 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
+#include "config_begin.hpp"
 
 namespace boost {
 namespace container {
@@ -162,5 +162,5 @@
 
 #endif //#ifndef BOOST_CONTAINERS_CONTAINER_DETAIL_TYPE_TRAITS_HPP
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 

Modified: branches/release/boost/interprocess/containers/container/detail/utilities.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/utilities.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/utilities.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -11,13 +11,15 @@
 #ifndef BOOST_CONTAINERS_DETAIL_UTILITIES_HPP
 #define BOOST_CONTAINERS_DETAIL_UTILITIES_HPP
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
+#include "config_begin.hpp"
 #include <cstdio>
 #include <boost/type_traits/is_fundamental.hpp>
 #include <boost/type_traits/is_pointer.hpp>
-#include <boost/interprocess/detail/move.hpp>
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
-#include <boost/interprocess/containers/container/detail/type_traits.hpp>
+#include <boost/type_traits/is_enum.hpp>
+#include <boost/type_traits/is_member_pointer.hpp>
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_TYPE_TRAITS_HPP
 #include <algorithm>
 
 namespace boost {
@@ -96,12 +98,43 @@
    enum { value = ((OrigSize-1)/RoundTo+1)*RoundTo };
 };
 
+template <class _TypeT>
+struct __rw_is_enum
+{
+struct _C_no { };
+struct _C_yes { int _C_dummy [2]; };
+
+struct _C_indirect {
+// prevent classes with user-defined conversions from matching
+
+// use double to prevent float->int gcc conversion warnings
+_C_indirect (double);
+};
+
+// nested struct gets rid of bogus gcc errors
+struct _C_nest {
+// supply first argument to prevent HP aCC warnings
+static _C_no _C_is (int, ...);
+static _C_yes _C_is (int, _C_indirect);
+
+static _TypeT _C_make_T ();
+};
+
+enum {
+_C_val = sizeof (_C_yes)
+== sizeof (_C_nest::_C_is (0, _C_nest::_C_make_T ()))
+&& !::boost::is_fundamental<_TypeT>::value
+};
+
+};
+
 template<class T>
 struct move_const_ref_type
    : if_c
- < ::boost::is_fundamental<T>::value || ::boost::is_pointer<T>::value
+ < ::boost::is_fundamental<T>::value || ::boost::is_pointer<T>::value ||
+ ::boost::is_member_pointer<T>::value || ::boost::is_enum<T>::value
    ,const T &
- ,BOOST_INTERPROCESS_CATCH_CONST_RLVALUE(T)
+ ,BOOST_MOVE_MACRO_CATCH_CONST_RLVALUE(T)
>
 {};
 
@@ -110,6 +143,6 @@
 } //namespace boost {
 
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //#ifndef BOOST_CONTAINERS_DETAIL_UTILITIES_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/value_init.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/value_init.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/value_init.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -17,8 +17,8 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
 
 namespace boost {
 namespace container {
@@ -38,6 +38,6 @@
 } //namespace container {
 } //namespace boost {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //#ifndef BOOST_CONTAINERS_DETAIL_VALUE_INIT_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/variadic_templates_tools.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/variadic_templates_tools.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/variadic_templates_tools.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -15,9 +15,9 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
-#include <boost/interprocess/containers/container/detail/type_traits.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_TYPE_TRAITS_HPP
 #include <cstddef> //std::size_t
 
 namespace boost {
@@ -148,6 +148,6 @@
 
 }}} //namespace boost { namespace container { namespace containers_detail {
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //#ifndef BOOST_CONTAINERS_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP

Modified: branches/release/boost/interprocess/containers/container/detail/version_type.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/version_type.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/version_type.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -16,8 +16,10 @@
 #ifndef BOOST_CONTAINERS_DETAIL_VERSION_TYPE_HPP
 #define BOOST_CONTAINERS_DETAIL_VERSION_TYPE_HPP
 
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
-#include <boost/interprocess/containers/container/detail/type_traits.hpp>
+#include "config_begin.hpp"
+
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_TYPE_TRAITS_HPP
 
 
 namespace boost{

Modified: branches/release/boost/interprocess/containers/container/detail/workaround.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/detail/workaround.hpp (original)
+++ branches/release/boost/interprocess/containers/container/detail/workaround.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -11,14 +11,14 @@
 #ifndef BOOST_CONTAINERS_DETAIL_WORKAROUND_HPP
 #define BOOST_CONTAINERS_DETAIL_WORKAROUND_HPP
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
+#include "config_begin.hpp"
 
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)\
- && !defined(BOOST_INTERPROCESS_DISABLE_VARIADIC_TMPL)
+#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_NO_VARIADIC_TEMPLATES)\
+ && !defined(BOOST_MOVE_MACRO_DISABLE_VARIADIC_TMPL)
 #define BOOST_CONTAINERS_PERFECT_FORWARDING
 
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //#ifndef BOOST_CONTAINERS_DETAIL_WORKAROUND_HPP

Modified: branches/release/boost/interprocess/containers/container/flat_map.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/flat_map.hpp (original)
+++ branches/release/boost/interprocess/containers/container/flat_map.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -15,18 +15,18 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
 
-#include <boost/interprocess/containers/container/container_fwd.hpp>
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
 #include <utility>
 #include <functional>
 #include <memory>
 #include <stdexcept>
-#include <boost/interprocess/containers/container/detail/flat_tree.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_FLAT_TREE_HPP
 #include <boost/type_traits/has_trivial_destructor.hpp>
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
-#include <boost/interprocess/detail/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 
 #ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
 namespace boost {
@@ -76,7 +76,7 @@
 {
    /// @cond
    private:
- BOOST_COPYABLE_AND_MOVABLE(flat_map)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(flat_map)
    //This is the tree that we should store if pair was movable
    typedef containers_detail::flat_tree<Key,
                            std::pair<Key, T>,
@@ -121,23 +121,32 @@
    public:
 
    // typedefs:
- typedef typename tree_t::key_type key_type;
- typedef typename tree_t::value_type value_type;
- typedef typename tree_t::pointer pointer;
- typedef typename tree_t::const_pointer const_pointer;
- typedef typename tree_t::reference reference;
- typedef typename tree_t::const_reference const_reference;
- typedef typename tree_t::value_compare value_compare;
- typedef T mapped_type;
- typedef typename tree_t::key_compare key_compare;
- typedef typename tree_t::iterator iterator;
- typedef typename tree_t::const_iterator const_iterator;
- typedef typename tree_t::reverse_iterator reverse_iterator;
- typedef typename tree_t::const_reverse_iterator const_reverse_iterator;
- typedef typename tree_t::size_type size_type;
- typedef typename tree_t::difference_type difference_type;
- typedef typename tree_t::allocator_type allocator_type;
- typedef typename tree_t::stored_allocator_type stored_allocator_type;
+ typedef typename impl_tree_t::key_type key_type;
+ typedef T mapped_type;
+ typedef typename std::pair<key_type, mapped_type> value_type;
+ typedef typename Alloc::pointer pointer;
+ typedef typename Alloc::const_pointer const_pointer;
+ typedef typename Alloc::reference reference;
+ typedef typename Alloc::const_reference const_reference;
+ typedef containers_detail::flat_tree_value_compare
+ < Pred
+ , containers_detail::select1st< std::pair<Key, T> >
+ , std::pair<Key, T> > value_compare;
+ typedef Pred key_compare;
+ typedef typename containers_detail::
+ get_flat_tree_iterators<pointer>::iterator iterator;
+ typedef typename containers_detail::
+ get_flat_tree_iterators<pointer>::const_iterator const_iterator;
+ typedef typename containers_detail::
+ get_flat_tree_iterators
+ <pointer>::reverse_iterator reverse_iterator;
+ typedef typename containers_detail::
+ get_flat_tree_iterators
+ <pointer>::const_reverse_iterator const_reverse_iterator;
+ typedef typename impl_tree_t::size_type size_type;
+ typedef typename impl_tree_t::difference_type difference_type;
+ typedef Alloc allocator_type;
+ typedef Alloc stored_allocator_type;
 
    //! <b>Effects</b>: Constructs an empty flat_map using the specified
    //! comparison object and allocator.
@@ -183,14 +192,14 @@
    //! <b>Complexity</b>: Construct.
    //!
    //! <b>Postcondition</b>: x is emptied.
- flat_map(BOOST_INTERPROCESS_RV_REF(flat_map) x)
- : m_flat_tree(boost::interprocess::move(x.m_flat_tree))
+ flat_map(BOOST_MOVE_MACRO_RV_REF(flat_map) x)
+ : m_flat_tree(BOOST_CONTAINER_MOVE_NAMESPACE::move(x.m_flat_tree))
    {}
 
    //! <b>Effects</b>: Makes *this a copy of x.
    //!
    //! <b>Complexity</b>: Linear in x.size().
- flat_map<Key,T,Pred,Alloc>& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(flat_map) x)
+ flat_map<Key,T,Pred,Alloc>& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(flat_map) x)
    { m_flat_tree = x.m_flat_tree; return *this; }
 
    //! <b>Effects</b>: Move constructs a flat_map.
@@ -199,8 +208,8 @@
    //! <b>Complexity</b>: Construct.
    //!
    //! <b>Postcondition</b>: x is emptied.
- flat_map<Key,T,Pred,Alloc>& operator=(BOOST_INTERPROCESS_RV_REF(flat_map) mx)
- { m_flat_tree = boost::interprocess::move(mx.m_flat_tree); return *this; }
+ flat_map<Key,T,Pred,Alloc>& operator=(BOOST_MOVE_MACRO_RV_REF(flat_map) mx)
+ { m_flat_tree = BOOST_CONTAINER_MOVE_NAMESPACE::move(mx.m_flat_tree); return *this; }
 
    //! <b>Effects</b>: Returns the comparison object out
    //! of which a was constructed.
@@ -376,13 +385,13 @@
    //! Returns: A reference to the mapped_type corresponding to x in *this.
    //!
    //! Complexity: Logarithmic.
- T &operator[](BOOST_INTERPROCESS_RV_REF(key_type) mk)
+ T &operator[](BOOST_MOVE_MACRO_RV_REF(key_type) mk)
    {
       key_type &k = mk;
       iterator i = lower_bound(k);
       // i->first is greater than or equivalent to k.
       if (i == end() || key_comp()(k, (*i).first))
- i = insert(i, value_type(boost::interprocess::move(k), boost::interprocess::move(T())));
+ i = insert(i, value_type(BOOST_CONTAINER_MOVE_NAMESPACE::move(k), BOOST_CONTAINER_MOVE_NAMESPACE::move(T())));
       return (*i).second;
    }
 
@@ -445,9 +454,9 @@
    //! to the elements with bigger keys than x.
    //!
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
- std::pair<iterator,bool> insert(BOOST_INTERPROCESS_RV_REF(value_type) x)
+ std::pair<iterator,bool> insert(BOOST_MOVE_MACRO_RV_REF(value_type) x)
    { return force<std::pair<iterator,bool> >(
- m_flat_tree.insert_unique(boost::interprocess::move(force<impl_value_type>(x)))); }
+ m_flat_tree.insert_unique(BOOST_CONTAINER_MOVE_NAMESPACE::move(force<impl_value_type>(x)))); }
 
    //! <b>Effects</b>: Inserts a new value_type move constructed from the pair if and
    //! only if there is no element in the container with key equivalent to the key of x.
@@ -460,10 +469,10 @@
    //! to the elements with bigger keys than x.
    //!
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
- std::pair<iterator,bool> insert(BOOST_INTERPROCESS_RV_REF(impl_value_type) x)
+ std::pair<iterator,bool> insert(BOOST_MOVE_MACRO_RV_REF(impl_value_type) x)
    {
       return force<std::pair<iterator,bool> >
- (m_flat_tree.insert_unique(boost::interprocess::move(x)));
+ (m_flat_tree.insert_unique(BOOST_CONTAINER_MOVE_NAMESPACE::move(x)));
    }
 
    //! <b>Effects</b>: Inserts a copy of x in the container if and only if there is
@@ -490,9 +499,9 @@
    //! right before p) plus insertion linear to the elements with bigger keys than x.
    //!
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
- iterator insert(const_iterator position, BOOST_INTERPROCESS_RV_REF(value_type) x)
+ iterator insert(const_iterator position, BOOST_MOVE_MACRO_RV_REF(value_type) x)
       { return force_copy<iterator>(
- m_flat_tree.insert_unique(force<impl_const_iterator>(position), boost::interprocess::move(force<impl_value_type>(x)))); }
+ m_flat_tree.insert_unique(force<impl_const_iterator>(position), BOOST_CONTAINER_MOVE_NAMESPACE::move(force<impl_value_type>(x)))); }
 
    //! <b>Effects</b>: Inserts an element move constructed from x in the container.
    //! p is a hint pointing to where the insert should start to search.
@@ -503,10 +512,10 @@
    //! right before p) plus insertion linear to the elements with bigger keys than x.
    //!
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
- iterator insert(const_iterator position, BOOST_INTERPROCESS_RV_REF(impl_value_type) x)
+ iterator insert(const_iterator position, BOOST_MOVE_MACRO_RV_REF(impl_value_type) x)
    {
       return force_copy<iterator>(
- m_flat_tree.insert_unique(force<impl_const_iterator>(position), boost::interprocess::move(x)));
+ m_flat_tree.insert_unique(force<impl_const_iterator>(position), BOOST_CONTAINER_MOVE_NAMESPACE::move(x)));
    }
 
    //! <b>Requires</b>: i, j are not iterators into *this.
@@ -538,7 +547,7 @@
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
    template <class... Args>
    iterator emplace(Args&&... args)
- { return force_copy<iterator>(m_flat_tree.emplace_unique(boost::interprocess::forward<Args>(args)...)); }
+ { return force_copy<iterator>(m_flat_tree.emplace_unique(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...)); }
 
    //! <b>Effects</b>: Inserts an object of type T constructed with
    //! std::forward<Args>(args)... in the container if and only if there is
@@ -554,7 +563,7 @@
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
    template <class... Args>
    iterator emplace_hint(const_iterator hint, Args&&... args)
- { return force_copy<iterator>(m_flat_tree.emplace_hint_unique(force<impl_const_iterator>(hint), boost::interprocess::forward<Args>(args)...)); }
+ { return force_copy<iterator>(m_flat_tree.emplace_hint_unique(force<impl_const_iterator>(hint), BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...)); }
 
    #else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
 
@@ -809,7 +818,7 @@
 {
    /// @cond
    private:
- BOOST_COPYABLE_AND_MOVABLE(flat_multimap)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(flat_multimap)
    typedef containers_detail::flat_tree<Key,
                            std::pair<Key, T>,
                            containers_detail::select1st< std::pair<Key, T> >,
@@ -851,23 +860,32 @@
    public:
 
    // typedefs:
- typedef typename tree_t::key_type key_type;
- typedef typename tree_t::value_type value_type;
- typedef typename tree_t::pointer pointer;
- typedef typename tree_t::const_pointer const_pointer;
- typedef typename tree_t::reference reference;
- typedef typename tree_t::const_reference const_reference;
- typedef typename tree_t::value_compare value_compare;
- typedef T mapped_type;
- typedef typename tree_t::key_compare key_compare;
- typedef typename tree_t::iterator iterator;
- typedef typename tree_t::const_iterator const_iterator;
- typedef typename tree_t::reverse_iterator reverse_iterator;
- typedef typename tree_t::const_reverse_iterator const_reverse_iterator;
- typedef typename tree_t::size_type size_type;
- typedef typename tree_t::difference_type difference_type;
- typedef typename tree_t::allocator_type allocator_type;
- typedef typename tree_t::stored_allocator_type stored_allocator_type;
+ typedef typename impl_tree_t::key_type key_type;
+ typedef T mapped_type;
+ typedef typename std::pair<key_type, mapped_type> value_type;
+ typedef typename Alloc::pointer pointer;
+ typedef typename Alloc::const_pointer const_pointer;
+ typedef typename Alloc::reference reference;
+ typedef typename Alloc::const_reference const_reference;
+ typedef containers_detail::flat_tree_value_compare
+ < Pred
+ , containers_detail::select1st< std::pair<Key, T> >
+ , std::pair<Key, T> > value_compare;
+ typedef Pred key_compare;
+ typedef typename containers_detail::
+ get_flat_tree_iterators<pointer>::iterator iterator;
+ typedef typename containers_detail::
+ get_flat_tree_iterators<pointer>::const_iterator const_iterator;
+ typedef typename containers_detail::
+ get_flat_tree_iterators
+ <pointer>::reverse_iterator reverse_iterator;
+ typedef typename containers_detail::
+ get_flat_tree_iterators
+ <pointer>::const_reverse_iterator const_reverse_iterator;
+ typedef typename impl_tree_t::size_type size_type;
+ typedef typename impl_tree_t::difference_type difference_type;
+ typedef Alloc allocator_type;
+ typedef Alloc stored_allocator_type;
 
    //! <b>Effects</b>: Constructs an empty flat_multimap using the specified comparison
    //! object and allocator.
@@ -914,21 +932,21 @@
    //! <b>Complexity</b>: Construct.
    //!
    //! <b>Postcondition</b>: x is emptied.
- flat_multimap(BOOST_INTERPROCESS_RV_REF(flat_multimap) x)
- : m_flat_tree(boost::interprocess::move(x.m_flat_tree))
+ flat_multimap(BOOST_MOVE_MACRO_RV_REF(flat_multimap) x)
+ : m_flat_tree(BOOST_CONTAINER_MOVE_NAMESPACE::move(x.m_flat_tree))
    { }
 
    //! <b>Effects</b>: Makes *this a copy of x.
    //!
    //! <b>Complexity</b>: Linear in x.size().
- flat_multimap<Key,T,Pred,Alloc>& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(flat_multimap) x)
+ flat_multimap<Key,T,Pred,Alloc>& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(flat_multimap) x)
       { m_flat_tree = x.m_flat_tree; return *this; }
 
    //! <b>Effects</b>: this->swap(x.get()).
    //!
    //! <b>Complexity</b>: Constant.
- flat_multimap<Key,T,Pred,Alloc>& operator=(BOOST_INTERPROCESS_RV_REF(flat_multimap) mx)
- { m_flat_tree = boost::interprocess::move(mx.m_flat_tree); return *this; }
+ flat_multimap<Key,T,Pred,Alloc>& operator=(BOOST_MOVE_MACRO_RV_REF(flat_multimap) mx)
+ { m_flat_tree = BOOST_CONTAINER_MOVE_NAMESPACE::move(mx.m_flat_tree); return *this; }
 
    //! <b>Effects</b>: Returns the comparison object out
    //! of which a was constructed.
@@ -1075,8 +1093,8 @@
    //! to the elements with bigger keys than x.
    //!
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
- iterator insert(BOOST_INTERPROCESS_RV_REF(value_type) x)
- { return force_copy<iterator>(m_flat_tree.insert_equal(boost::interprocess::move(x))); }
+ iterator insert(BOOST_MOVE_MACRO_RV_REF(value_type) x)
+ { return force_copy<iterator>(m_flat_tree.insert_equal(BOOST_CONTAINER_MOVE_NAMESPACE::move(x))); }
 
    //! <b>Effects</b>: Inserts a new value move-constructed from x and returns
    //! the iterator pointing to the newly inserted element.
@@ -1085,8 +1103,8 @@
    //! to the elements with bigger keys than x.
    //!
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
- iterator insert(BOOST_INTERPROCESS_RV_REF(impl_value_type) x)
- { return force_copy<iterator>(m_flat_tree.insert_equal(boost::interprocess::move(x))); }
+ iterator insert(BOOST_MOVE_MACRO_RV_REF(impl_value_type) x)
+ { return force_copy<iterator>(m_flat_tree.insert_equal(BOOST_CONTAINER_MOVE_NAMESPACE::move(x))); }
 
    //! <b>Effects</b>: Inserts a copy of x in the container.
    //! p is a hint pointing to where the insert should start to search.
@@ -1113,11 +1131,11 @@
    //! to the elements with bigger keys than x.
    //!
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
- iterator insert(const_iterator position, BOOST_INTERPROCESS_RV_REF(value_type) x)
+ iterator insert(const_iterator position, BOOST_MOVE_MACRO_RV_REF(value_type) x)
    {
       return force_copy<iterator>
          (m_flat_tree.insert_equal(force<impl_const_iterator>(position)
- , boost::interprocess::move(x)));
+ , BOOST_CONTAINER_MOVE_NAMESPACE::move(x)));
    }
 
    //! <b>Effects</b>: Inserts a value move constructed from x in the container.
@@ -1131,10 +1149,10 @@
    //! to the elements with bigger keys than x.
    //!
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
- iterator insert(const_iterator position, BOOST_INTERPROCESS_RV_REF(impl_value_type) x)
+ iterator insert(const_iterator position, BOOST_MOVE_MACRO_RV_REF(impl_value_type) x)
    {
       return force_copy<iterator>(
- m_flat_tree.insert_equal(force<impl_const_iterator>(position), boost::interprocess::move(x)));
+ m_flat_tree.insert_equal(force<impl_const_iterator>(position), BOOST_CONTAINER_MOVE_NAMESPACE::move(x)));
    }
 
    //! <b>Requires</b>: i, j are not iterators into *this.
@@ -1161,7 +1179,7 @@
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
    template <class... Args>
    iterator emplace(Args&&... args)
- { return force_copy<iterator>(m_flat_tree.emplace_equal(boost::interprocess::forward<Args>(args)...)); }
+ { return force_copy<iterator>(m_flat_tree.emplace_equal(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...)); }
 
    //! <b>Effects</b>: Inserts an object of type T constructed with
    //! std::forward<Args>(args)... in the container.
@@ -1179,7 +1197,7 @@
    iterator emplace_hint(const_iterator hint, Args&&... args)
    {
       return force_copy<iterator>(m_flat_tree.emplace_hint_equal
- (force<impl_const_iterator>(hint), boost::interprocess::forward<Args>(args)...));
+ (force<impl_const_iterator>(hint), BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...));
    }
 
    #else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -1406,6 +1424,6 @@
 
 /// @endcond
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif /* BOOST_CONTAINERS_FLAT_MAP_HPP */

Modified: branches/release/boost/interprocess/containers/container/flat_set.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/flat_set.hpp (original)
+++ branches/release/boost/interprocess/containers/container/flat_set.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -15,16 +15,16 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
 
-#include <boost/interprocess/containers/container/container_fwd.hpp>
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
 #include <utility>
 #include <functional>
 #include <memory>
-#include <boost/interprocess/containers/container/detail/flat_tree.hpp>
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
-#include <boost/interprocess/detail/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_FLAT_TREE_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 
 #ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
 namespace boost {
@@ -65,7 +65,7 @@
 {
    /// @cond
    private:
- BOOST_COPYABLE_AND_MOVABLE(flat_set)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(flat_set)
    typedef containers_detail::flat_tree<T, T, containers_detail::identity<T>, Pred, Alloc> tree_t;
    tree_t m_flat_tree; // flat tree representing flat_set
    typedef typename containers_detail::
@@ -139,21 +139,21 @@
    //! <b>Complexity</b>: Construct.
    //!
    //! <b>Postcondition</b>: x is emptied.
- flat_set(BOOST_INTERPROCESS_RV_REF(flat_set) mx)
- : m_flat_tree(boost::interprocess::move(mx.m_flat_tree))
+ flat_set(BOOST_MOVE_MACRO_RV_REF(flat_set) mx)
+ : m_flat_tree(BOOST_CONTAINER_MOVE_NAMESPACE::move(mx.m_flat_tree))
    {}
 
    //! <b>Effects</b>: Makes *this a copy of x.
    //!
    //! <b>Complexity</b>: Linear in x.size().
- flat_set<T,Pred,Alloc>& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(flat_set) x)
+ flat_set<T,Pred,Alloc>& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(flat_set) x)
       { m_flat_tree = x.m_flat_tree; return *this; }
 
    //! <b>Effects</b>: Makes *this a copy of x.
    //!
    //! <b>Complexity</b>: Linear in x.size().
- flat_set<T,Pred,Alloc>& operator=(BOOST_INTERPROCESS_RV_REF(flat_set) mx)
- { m_flat_tree = boost::interprocess::move(mx.m_flat_tree); return *this; }
+ flat_set<T,Pred,Alloc>& operator=(BOOST_MOVE_MACRO_RV_REF(flat_set) mx)
+ { m_flat_tree = BOOST_CONTAINER_MOVE_NAMESPACE::move(mx.m_flat_tree); return *this; }
 
    //! <b>Effects</b>: Returns the comparison object out
    //! of which a was constructed.
@@ -331,12 +331,12 @@
    std::pair<iterator, bool> insert(insert_const_ref_type x)
    { return priv_insert(x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    std::pair<iterator, bool> insert(T &x)
    { return this->insert(const_cast<const T &>(x)); }
 
    template<class U>
- std::pair<iterator, bool> insert(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ std::pair<iterator, bool> insert(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return priv_insert(u); }
    #endif
 
@@ -351,8 +351,8 @@
    //! to the elements with bigger keys than x.
    //!
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
- std::pair<iterator,bool> insert(BOOST_INTERPROCESS_RV_REF(value_type) x)
- { return m_flat_tree.insert_unique(boost::interprocess::move(x)); }
+ std::pair<iterator,bool> insert(BOOST_MOVE_MACRO_RV_REF(value_type) x)
+ { return m_flat_tree.insert_unique(BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Effects</b>: Inserts a copy of x in the container if and only if there is
    //! no element in the container with key equivalent to the key of x.
@@ -368,12 +368,12 @@
    iterator insert(const_iterator p, insert_const_ref_type x)
    { return priv_insert(p, x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    iterator insert(const_iterator position, T &x)
    { return this->insert(position, const_cast<const T &>(x)); }
 
    template<class U>
- iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return priv_insert(position, u); }
    #endif
 
@@ -386,8 +386,8 @@
    //! right before p) plus insertion linear to the elements with bigger keys than x.
    //!
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
- iterator insert(const_iterator position, BOOST_INTERPROCESS_RV_REF(value_type) x)
- { return m_flat_tree.insert_unique(position, boost::interprocess::move(x)); }
+ iterator insert(const_iterator position, BOOST_MOVE_MACRO_RV_REF(value_type) x)
+ { return m_flat_tree.insert_unique(position, BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Requires</b>: i, j are not iterators into *this.
    //!
@@ -418,7 +418,7 @@
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
    template <class... Args>
    iterator emplace(Args&&... args)
- { return m_flat_tree.emplace_unique(boost::interprocess::forward<Args>(args)...); }
+ { return m_flat_tree.emplace_unique(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    //! <b>Effects</b>: Inserts an object of type T constructed with
    //! std::forward<Args>(args)... in the container if and only if there is
@@ -434,7 +434,7 @@
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
    template <class... Args>
    iterator emplace_hint(const_iterator hint, Args&&... args)
- { return m_flat_tree.emplace_hint_unique(hint, boost::interprocess::forward<Args>(args)...); }
+ { return m_flat_tree.emplace_hint_unique(hint, BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    #else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
 
@@ -685,7 +685,7 @@
 {
    /// @cond
    private:
- BOOST_COPYABLE_AND_MOVABLE(flat_multiset)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(flat_multiset)
    typedef containers_detail::flat_tree<T, T, containers_detail::identity<T>, Pred, Alloc> tree_t;
    tree_t m_flat_tree; // flat tree representing flat_multiset
    typedef typename containers_detail::
@@ -740,15 +740,15 @@
    flat_multiset(const flat_multiset<T,Pred,Alloc>& x)
       : m_flat_tree(x.m_flat_tree) {}
 
- flat_multiset(BOOST_INTERPROCESS_RV_REF(flat_multiset) x)
- : m_flat_tree(boost::interprocess::move(x.m_flat_tree))
+ flat_multiset(BOOST_MOVE_MACRO_RV_REF(flat_multiset) x)
+ : m_flat_tree(BOOST_CONTAINER_MOVE_NAMESPACE::move(x.m_flat_tree))
    {}
 
- flat_multiset<T,Pred,Alloc>& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(flat_multiset) x)
+ flat_multiset<T,Pred,Alloc>& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(flat_multiset) x)
       { m_flat_tree = x.m_flat_tree; return *this; }
 
- flat_multiset<T,Pred,Alloc>& operator=(BOOST_INTERPROCESS_RV_REF(flat_multiset) mx)
- { m_flat_tree = boost::interprocess::move(mx.m_flat_tree); return *this; }
+ flat_multiset<T,Pred,Alloc>& operator=(BOOST_MOVE_MACRO_RV_REF(flat_multiset) mx)
+ { m_flat_tree = BOOST_CONTAINER_MOVE_NAMESPACE::move(mx.m_flat_tree); return *this; }
 
    //! <b>Effects</b>: Returns the comparison object out
    //! of which a was constructed.
@@ -922,12 +922,12 @@
    iterator insert(insert_const_ref_type x)
    { return priv_insert(x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    iterator insert(T &x)
    { return this->insert(const_cast<const T &>(x)); }
 
    template<class U>
- iterator insert(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ iterator insert(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return priv_insert(u); }
    #endif
 
@@ -938,8 +938,8 @@
    //! to the elements with bigger keys than x.
    //!
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
- iterator insert(BOOST_INTERPROCESS_RV_REF(value_type) x)
- { return m_flat_tree.insert_equal(boost::interprocess::move(x)); }
+ iterator insert(BOOST_MOVE_MACRO_RV_REF(value_type) x)
+ { return m_flat_tree.insert_equal(BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Effects</b>: Inserts a copy of x in the container.
    //! p is a hint pointing to where the insert should start to search.
@@ -954,12 +954,12 @@
    iterator insert(const_iterator p, insert_const_ref_type x)
    { return priv_insert(p, x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    iterator insert(const_iterator position, T &x)
    { return this->insert(position, const_cast<const T &>(x)); }
 
    template<class U>
- iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return priv_insert(position, u); }
    #endif
 
@@ -973,8 +973,8 @@
    //! right before p) plus insertion linear to the elements with bigger keys than x.
    //!
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
- iterator insert(const_iterator position, BOOST_INTERPROCESS_RV_REF(value_type) x)
- { return m_flat_tree.insert_equal(position, boost::interprocess::move(x)); }
+ iterator insert(const_iterator position, BOOST_MOVE_MACRO_RV_REF(value_type) x)
+ { return m_flat_tree.insert_equal(position, BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Requires</b>: i, j are not iterators into *this.
    //!
@@ -1000,7 +1000,7 @@
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
    template <class... Args>
    iterator emplace(Args&&... args)
- { return m_flat_tree.emplace_equal(boost::interprocess::forward<Args>(args)...); }
+ { return m_flat_tree.emplace_equal(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    //! <b>Effects</b>: Inserts an object of type T constructed with
    //! std::forward<Args>(args)... in the container.
@@ -1015,7 +1015,7 @@
    //! <b>Note</b>: If an element it's inserted it might invalidate elements.
    template <class... Args>
    iterator emplace_hint(const_iterator hint, Args&&... args)
- { return m_flat_tree.emplace_hint_equal(hint, boost::interprocess::forward<Args>(args)...); }
+ { return m_flat_tree.emplace_hint_equal(hint, BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    #else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
 
@@ -1240,6 +1240,6 @@
 
 }}
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif /* BOOST_CONTAINERS_FLAT_SET_HPP */

Modified: branches/release/boost/interprocess/containers/container/list.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/list.hpp (original)
+++ branches/release/boost/interprocess/containers/container/list.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -6,39 +6,6 @@
 //
 // See http://www.boost.org/libs/container for documentation.
 //
-//////////////////////////////////////////////////////////////////////////////
-//
-// This file comes from SGI's stl_list.h file. Modified by Ion Gaztanaga 2004
-// Renaming, isolating and porting to generic algorithms. Pointer typedef
-// set to allocator::pointer to allow placing it in shared memory.
-//
-///////////////////////////////////////////////////////////////////////////////
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
 
 #ifndef BOOST_CONTAINERS_LIST_HPP_
 #define BOOST_CONTAINERS_LIST_HPP_
@@ -47,23 +14,23 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
-#include <boost/interprocess/containers/container/container_fwd.hpp>
-#include <boost/interprocess/containers/container/detail/version_type.hpp>
-#include <boost/interprocess/detail/move.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 #include <boost/pointer_to_other.hpp>
-#include <boost/interprocess/containers/container/detail/utilities.hpp>
-#include <boost/interprocess/containers/container/detail/algorithms.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ALGORITHMS_HPP
 #include <boost/type_traits/has_trivial_destructor.hpp>
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
 #include <boost/intrusive/list.hpp>
-#include <boost/interprocess/containers/container/detail/node_alloc_holder.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_NODE_ALLOC_HOLDER_HPP
 
 #if defined(BOOST_CONTAINERS_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
 #else
 //Preprocessor library to emulate perfect forwarding
-#include <boost/interprocess/containers/container/detail/preprocessor.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
 #endif
 
 #include <stdexcept>
@@ -105,7 +72,7 @@
 
    template<class ...Args>
    list_node(Args &&...args)
- : m_data(boost::interprocess::forward<Args>(args)...)
+ : m_data(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...)
    {}
 
    #else //#ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -231,7 +198,7 @@
 
    /// @cond
    private:
- BOOST_COPYABLE_AND_MOVABLE(list)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(list)
    typedef difference_type list_difference_type;
    typedef pointer list_pointer;
    typedef const_pointer list_const_pointer;
@@ -390,8 +357,8 @@
    //! <b>Throws</b>: If allocator_type's copy constructor throws.
    //!
    //! <b>Complexity</b>: Constant.
- list(BOOST_INTERPROCESS_RV_REF(list) x)
- : AllocHolder(boost::interprocess::move(static_cast<AllocHolder&>(x)))
+ list(BOOST_MOVE_MACRO_RV_REF(list) x)
+ : AllocHolder(BOOST_CONTAINER_MOVE_NAMESPACE::move(static_cast<AllocHolder&>(x)))
    {}
 
    //! <b>Effects</b>: Constructs a list that will use a copy of allocator a
@@ -572,11 +539,11 @@
    void push_front(insert_const_ref_type x)
    { this->insert(this->cbegin(), x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    void push_front(T &x) { push_front(const_cast<const T &>(x)); }
 
    template<class U>
- void push_front(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ void push_front(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { this->insert(this->cbegin(), u); }
    #endif
 
@@ -586,8 +553,8 @@
    //! <b>Throws</b>: If memory allocation throws.
    //!
    //! <b>Complexity</b>: Amortized constant time.
- void push_front(BOOST_INTERPROCESS_RV_REF(T) x)
- { this->insert(this->cbegin(), boost::interprocess::move(x)); }
+ void push_front(BOOST_MOVE_MACRO_RV_REF(T) x)
+ { this->insert(this->cbegin(), BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Effects</b>: Removes the last element from the list.
    //!
@@ -597,11 +564,11 @@
    void push_back (insert_const_ref_type x)
    { this->insert(this->cend(), x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    void push_back(T &x) { push_back(const_cast<const T &>(x)); }
 
    template<class U>
- void push_back(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ void push_back(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { this->insert(this->cend(), u); }
 
    #endif
@@ -611,8 +578,8 @@
    //! <b>Throws</b>: Nothing.
    //!
    //! <b>Complexity</b>: Amortized constant time.
- void push_back (BOOST_INTERPROCESS_RV_REF(T) x)
- { this->insert(this->cend(), boost::interprocess::move(x)); }
+ void push_back (BOOST_MOVE_MACRO_RV_REF(T) x)
+ { this->insert(this->cend(), BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Effects</b>: Removes the first element from the list.
    //!
@@ -749,7 +716,7 @@
    //! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
    //!
    //! <b>Complexity</b>: Linear to the number of elements in x.
- ThisType& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(ThisType) x)
+ ThisType& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(ThisType) x)
    {
       if (this != &x) {
          this->assign(x.begin(), x.end());
@@ -765,7 +732,7 @@
    //! <b>Throws</b>: If allocator_type's copy constructor throws.
    //!
    //! <b>Complexity</b>: Constant.
- ThisType& operator=(BOOST_INTERPROCESS_RV_REF(ThisType) mx)
+ ThisType& operator=(BOOST_MOVE_MACRO_RV_REF(ThisType) mx)
    {
       this->clear();
       this->swap(mx);
@@ -808,11 +775,11 @@
    iterator insert(const_iterator position, insert_const_ref_type x)
    { return this->priv_insert(position, x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    iterator insert(const_iterator position, T &x) { return this->insert(position, const_cast<const T &>(x)); }
 
    template<class U>
- iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return this->priv_insert(position, u); }
    #endif
 
@@ -823,9 +790,9 @@
    //! <b>Throws</b>: If memory allocation throws.
    //!
    //! <b>Complexity</b>: Amortized constant time.
- iterator insert(const_iterator p, BOOST_INTERPROCESS_RV_REF(T) x)
+ iterator insert(const_iterator p, BOOST_MOVE_MACRO_RV_REF(T) x)
    {
- NodePtr tmp = AllocHolder::create_node(boost::interprocess::move(x));
+ NodePtr tmp = AllocHolder::create_node(BOOST_CONTAINER_MOVE_NAMESPACE::move(x));
       return iterator(this->icont().insert(p.get(), *tmp));
    }
 
@@ -841,7 +808,7 @@
    template <class... Args>
    void emplace_back(Args&&... args)
    {
- this->emplace(this->cend(), boost::interprocess::forward<Args>(args)...);
+ this->emplace(this->cend(), BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
    }
 
    //! <b>Effects</b>: Inserts an object of type T constructed with
@@ -854,7 +821,7 @@
    template <class... Args>
    void emplace_front(Args&&... args)
    {
- this->emplace(this->cbegin(), boost::interprocess::forward<Args>(args)...);
+ this->emplace(this->cbegin(), BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
    }
 
    //! <b>Effects</b>: Inserts an object of type T constructed with
@@ -868,7 +835,7 @@
    iterator emplace(const_iterator p, Args&&... args)
    {
       typename AllocHolder::Deallocator d(AllocHolder::create_node_and_deallocator());
- new ((void*)containers_detail::get_pointer(d.get())) Node(boost::interprocess::forward<Args>(args)...);
+ new ((void*)containers_detail::get_pointer(d.get())) Node(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
       NodePtr node = d.get();
       d.release();
       return iterator(this->icont().insert(p.get(), *node));
@@ -1399,6 +1366,6 @@
 
 }}
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif // BOOST_CONTAINERS_LIST_HPP_

Modified: branches/release/boost/interprocess/containers/container/map.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/map.hpp (original)
+++ branches/release/boost/interprocess/containers/container/map.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -47,21 +47,21 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
 
-#include <boost/interprocess/containers/container/container_fwd.hpp>
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
 #include <utility>
 #include <functional>
 #include <memory>
 #include <stdexcept>
-#include <boost/interprocess/containers/container/detail/tree.hpp>
-#include <boost/interprocess/containers/container/detail/value_init.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_TREE_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_VALUE_INIT_HPP
 #include <boost/type_traits/has_trivial_destructor.hpp>
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
-#include <boost/interprocess/containers/container/detail/utilities.hpp>
-#include <boost/interprocess/containers/container/detail/pair.hpp>
-#include <boost/interprocess/detail/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PAIR_HPP
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 
 #ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
 namespace boost {
@@ -99,7 +99,7 @@
 {
    /// @cond
    private:
- BOOST_COPYABLE_AND_MOVABLE(map)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(map)
    typedef containers_detail::rbtree<Key,
                            std::pair<const Key, T>,
                            containers_detail::select1st< std::pair<const Key, T> >,
@@ -193,21 +193,21 @@
    //! <b>Complexity</b>: Construct.
    //!
    //! <b>Postcondition</b>: x is emptied.
- map(BOOST_INTERPROCESS_RV_REF(map) x)
- : m_tree(boost::interprocess::move(x.m_tree))
+ map(BOOST_MOVE_MACRO_RV_REF(map) x)
+ : m_tree(BOOST_CONTAINER_MOVE_NAMESPACE::move(x.m_tree))
    {}
 
    //! <b>Effects</b>: Makes *this a copy of x.
    //!
    //! <b>Complexity</b>: Linear in x.size().
- map& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(map) x)
+ map& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(map) x)
    { m_tree = x.m_tree; return *this; }
 
    //! <b>Effects</b>: this->swap(x.get()).
    //!
    //! <b>Complexity</b>: Constant.
- map& operator=(BOOST_INTERPROCESS_RV_REF(map) x)
- { m_tree = boost::interprocess::move(x.m_tree); return *this; }
+ map& operator=(BOOST_MOVE_MACRO_RV_REF(map) x)
+ { m_tree = BOOST_CONTAINER_MOVE_NAMESPACE::move(x.m_tree); return *this; }
 
    //! <b>Effects</b>: Returns the comparison object out
    //! of which a was constructed.
@@ -341,27 +341,27 @@
       // i->first is greater than or equivalent to k.
       if (i == end() || key_comp()(k, (*i).first)){
          containers_detail::value_init<T> v;
- value_type val(k, boost::interprocess::move(v.m_t));
- i = insert(i, boost::interprocess::move(val));
+ value_type val(k, BOOST_CONTAINER_MOVE_NAMESPACE::move(v.m_t));
+ i = insert(i, BOOST_CONTAINER_MOVE_NAMESPACE::move(val));
       }
       return (*i).second;
    }
 
    //! Effects: If there is no key equivalent to x in the map, inserts
- //! value_type(boost::interprocess::move(x), T()) into the map (the key is move-constructed)
+ //! value_type(BOOST_CONTAINER_MOVE_NAMESPACE::move(x), T()) into the map (the key is move-constructed)
    //!
    //! Returns: A reference to the mapped_type corresponding to x in *this.
    //!
    //! Complexity: Logarithmic.
- T& operator[](BOOST_INTERPROCESS_RV_REF(key_type) mk)
+ T& operator[](BOOST_MOVE_MACRO_RV_REF(key_type) mk)
    {
       key_type &k = mk;
       //we can optimize this
       iterator i = lower_bound(k);
       // i->first is greater than or equivalent to k.
       if (i == end() || key_comp()(k, (*i).first)){
- value_type val(boost::interprocess::move(k), boost::interprocess::move(T()));
- i = insert(i, boost::interprocess::move(val));
+ value_type val(BOOST_CONTAINER_MOVE_NAMESPACE::move(k), BOOST_CONTAINER_MOVE_NAMESPACE::move(T()));
+ i = insert(i, BOOST_CONTAINER_MOVE_NAMESPACE::move(val));
       }
       return (*i).second;
    }
@@ -429,8 +429,8 @@
    //! points to the element with key equivalent to the key of x.
    //!
    //! <b>Complexity</b>: Logarithmic.
- std::pair<iterator,bool> insert(BOOST_INTERPROCESS_RV_REF(nonconst_value_type) x)
- { return m_tree.insert_unique(boost::interprocess::move(x)); }
+ std::pair<iterator,bool> insert(BOOST_MOVE_MACRO_RV_REF(nonconst_value_type) x)
+ { return m_tree.insert_unique(BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Effects</b>: Inserts a new value_type move constructed from the pair if and
    //! only if there is no element in the container with key equivalent to the key of x.
@@ -440,8 +440,8 @@
    //! points to the element with key equivalent to the key of x.
    //!
    //! <b>Complexity</b>: Logarithmic.
- std::pair<iterator,bool> insert(BOOST_INTERPROCESS_RV_REF(nonconst_impl_value_type) x)
- { return m_tree.insert_unique(boost::interprocess::move(x)); }
+ std::pair<iterator,bool> insert(BOOST_MOVE_MACRO_RV_REF(nonconst_impl_value_type) x)
+ { return m_tree.insert_unique(BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Effects</b>: Move constructs a new value from x if and only if there is
    //! no element in the container with key equivalent to the key of x.
@@ -451,8 +451,8 @@
    //! points to the element with key equivalent to the key of x.
    //!
    //! <b>Complexity</b>: Logarithmic.
- std::pair<iterator,bool> insert(BOOST_INTERPROCESS_RV_REF(value_type) x)
- { return m_tree.insert_unique(boost::interprocess::move(x)); }
+ std::pair<iterator,bool> insert(BOOST_MOVE_MACRO_RV_REF(value_type) x)
+ { return m_tree.insert_unique(BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Effects</b>: Inserts a copy of x in the container if and only if there is
    //! no element in the container with key equivalent to the key of x.
@@ -475,8 +475,8 @@
    //!
    //! <b>Complexity</b>: Logarithmic in general, but amortized constant if t
    //! is inserted right before p.
- iterator insert(iterator position, BOOST_INTERPROCESS_RV_REF(nonconst_value_type) x)
- { return m_tree.insert_unique(position, boost::interprocess::move(x)); }
+ iterator insert(iterator position, BOOST_MOVE_MACRO_RV_REF(nonconst_value_type) x)
+ { return m_tree.insert_unique(position, BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Effects</b>: Move constructs a new value from x if and only if there is
    //! no element in the container with key equivalent to the key of x.
@@ -487,8 +487,8 @@
    //!
    //! <b>Complexity</b>: Logarithmic in general, but amortized constant if t
    //! is inserted right before p.
- iterator insert(iterator position, BOOST_INTERPROCESS_RV_REF(nonconst_impl_value_type) x)
- { return m_tree.insert_unique(position, boost::interprocess::move(x)); }
+ iterator insert(iterator position, BOOST_MOVE_MACRO_RV_REF(nonconst_impl_value_type) x)
+ { return m_tree.insert_unique(position, BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Effects</b>: Inserts a copy of x in the container.
    //! p is a hint pointing to where the insert should start to search.
@@ -505,8 +505,8 @@
    //! <b>Returns</b>: An iterator pointing to the element with key equivalent to the key of x.
    //!
    //! <b>Complexity</b>: Logarithmic.
- iterator insert(iterator position, BOOST_INTERPROCESS_RV_REF(value_type) x)
- { return m_tree.insert_unique(position, boost::interprocess::move(x)); }
+ iterator insert(iterator position, BOOST_MOVE_MACRO_RV_REF(value_type) x)
+ { return m_tree.insert_unique(position, BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Requires</b>: i, j are not iterators into *this.
    //!
@@ -532,7 +532,7 @@
    //! is inserted right before p.
    template <class... Args>
    iterator emplace(Args&&... args)
- { return m_tree.emplace_unique(boost::interprocess::forward<Args>(args)...); }
+ { return m_tree.emplace_unique(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    //! <b>Effects</b>: Inserts an object of type T constructed with
    //! std::forward<Args>(args)... in the container if and only if there is
@@ -546,7 +546,7 @@
    //! is inserted right before p.
    template <class... Args>
    iterator emplace_hint(const_iterator hint, Args&&... args)
- { return m_tree.emplace_hint_unique(hint, boost::interprocess::forward<Args>(args)...); }
+ { return m_tree.emplace_hint_unique(hint, BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    #else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
 
@@ -752,7 +752,7 @@
 {
    /// @cond
    private:
- BOOST_COPYABLE_AND_MOVABLE(multimap)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(multimap)
    typedef containers_detail::rbtree<Key,
                            std::pair<const Key, T>,
                            containers_detail::select1st< std::pair<const Key, T> >,
@@ -847,21 +847,21 @@
    //! <b>Complexity</b>: Construct.
    //!
    //! <b>Postcondition</b>: x is emptied.
- multimap(BOOST_INTERPROCESS_RV_REF(multimap) x)
- : m_tree(boost::interprocess::move(x.m_tree))
+ multimap(BOOST_MOVE_MACRO_RV_REF(multimap) x)
+ : m_tree(BOOST_CONTAINER_MOVE_NAMESPACE::move(x.m_tree))
    {}
 
    //! <b>Effects</b>: Makes *this a copy of x.
    //!
    //! <b>Complexity</b>: Linear in x.size().
- multimap& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(multimap) x)
+ multimap& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(multimap) x)
    { m_tree = x.m_tree; return *this; }
 
    //! <b>Effects</b>: this->swap(x.get()).
    //!
    //! <b>Complexity</b>: Constant.
- multimap& operator=(BOOST_INTERPROCESS_RV_REF(multimap) x)
- { m_tree = boost::interprocess::move(x.m_tree); return *this; }
+ multimap& operator=(BOOST_MOVE_MACRO_RV_REF(multimap) x)
+ { m_tree = BOOST_CONTAINER_MOVE_NAMESPACE::move(x.m_tree); return *this; }
 
    //! <b>Effects</b>: Returns the comparison object out
    //! of which a was constructed.
@@ -1009,15 +1009,15 @@
    //! the iterator pointing to the newly inserted element.
    //!
    //! <b>Complexity</b>: Logarithmic.
- iterator insert(BOOST_INTERPROCESS_RV_REF(nonconst_value_type) x)
- { return m_tree.insert_equal(boost::interprocess::move(x)); }
+ iterator insert(BOOST_MOVE_MACRO_RV_REF(nonconst_value_type) x)
+ { return m_tree.insert_equal(BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Effects</b>: Inserts a new value move-constructed from x and returns
    //! the iterator pointing to the newly inserted element.
    //!
    //! <b>Complexity</b>: Logarithmic.
- iterator insert(BOOST_INTERPROCESS_RV_REF(nonconst_impl_value_type) x)
- { return m_tree.insert_equal(boost::interprocess::move(x)); }
+ iterator insert(BOOST_MOVE_MACRO_RV_REF(nonconst_impl_value_type) x)
+ { return m_tree.insert_equal(BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Effects</b>: Inserts a copy of x in the container.
    //! p is a hint pointing to where the insert should start to search.
@@ -1049,8 +1049,8 @@
    //!
    //! <b>Complexity</b>: Logarithmic in general, but amortized constant if t
    //! is inserted right before p.
- iterator insert(iterator position, BOOST_INTERPROCESS_RV_REF(nonconst_value_type) x)
- { return m_tree.insert_equal(position, boost::interprocess::move(x)); }
+ iterator insert(iterator position, BOOST_MOVE_MACRO_RV_REF(nonconst_value_type) x)
+ { return m_tree.insert_equal(position, BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Effects</b>: Inserts a new value move constructed from x in the container.
    //! p is a hint pointing to where the insert should start to search.
@@ -1060,8 +1060,8 @@
    //!
    //! <b>Complexity</b>: Logarithmic in general, but amortized constant if t
    //! is inserted right before p.
- iterator insert(iterator position, BOOST_INTERPROCESS_RV_REF(nonconst_impl_value_type) x)
- { return m_tree.insert_equal(position, boost::interprocess::move(x)); }
+ iterator insert(iterator position, BOOST_MOVE_MACRO_RV_REF(nonconst_impl_value_type) x)
+ { return m_tree.insert_equal(position, BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Requires</b>: i, j are not iterators into *this.
    //!
@@ -1085,7 +1085,7 @@
    //! is inserted right before p.
    template <class... Args>
    iterator emplace(Args&&... args)
- { return m_tree.emplace_equal(boost::interprocess::forward<Args>(args)...); }
+ { return m_tree.emplace_equal(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    //! <b>Effects</b>: Inserts an object of type T constructed with
    //! std::forward<Args>(args)... in the container.
@@ -1098,7 +1098,7 @@
    //! is inserted right before p.
    template <class... Args>
    iterator emplace_hint(const_iterator hint, Args&&... args)
- { return m_tree.emplace_hint_equal(hint, boost::interprocess::forward<Args>(args)...); }
+ { return m_tree.emplace_hint_equal(hint, BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    #else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
 
@@ -1280,7 +1280,7 @@
 
 }}
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif /* BOOST_CONTAINERS_MAP_HPP */
 

Modified: branches/release/boost/interprocess/containers/container/set.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/set.hpp (original)
+++ branches/release/boost/interprocess/containers/container/set.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -7,38 +7,6 @@
 // See http://www.boost.org/libs/container for documentation.
 //
 //////////////////////////////////////////////////////////////////////////////
-//
-// This file comes from SGI's stl_set/stl_multiset files. Modified by Ion Gaztanaga 2004.
-// Renaming, isolating and porting to generic algorithms. Pointer typedef
-// set to allocator::pointer to allow placing it in shared memory.
-//
-///////////////////////////////////////////////////////////////////////////////
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
 
 #ifndef BOOST_CONTAINERS_SET_HPP
 #define BOOST_CONTAINERS_SET_HPP
@@ -47,20 +15,20 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
-#include <boost/interprocess/containers/container/container_fwd.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
 
 #include <utility>
 #include <functional>
 #include <memory>
 
-#include <boost/interprocess/detail/move.hpp>
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
-#include <boost/interprocess/containers/container/detail/tree.hpp>
-#include <boost/interprocess/detail/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_TREE_HPP
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 #ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
-#include <boost/interprocess/containers/container/detail/preprocessor.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
 #endif
 
 #ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -94,7 +62,7 @@
 {
    /// @cond
    private:
- BOOST_COPYABLE_AND_MOVABLE(set)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(set)
    typedef containers_detail::rbtree<T, T,
                      containers_detail::identity<T>, Pred, Alloc> tree_t;
    tree_t m_tree; // red-black tree representing set
@@ -168,21 +136,21 @@
    //! <b>Complexity</b>: Construct.
    //!
    //! <b>Postcondition</b>: x is emptied.
- set(BOOST_INTERPROCESS_RV_REF(set) x)
- : m_tree(boost::interprocess::move(x.m_tree))
+ set(BOOST_MOVE_MACRO_RV_REF(set) x)
+ : m_tree(BOOST_CONTAINER_MOVE_NAMESPACE::move(x.m_tree))
    {}
 
    //! <b>Effects</b>: Makes *this a copy of x.
    //!
    //! <b>Complexity</b>: Linear in x.size().
- set& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(set) x)
+ set& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(set) x)
    { m_tree = x.m_tree; return *this; }
 
    //! <b>Effects</b>: this->swap(x.get()).
    //!
    //! <b>Complexity</b>: Constant.
- set& operator=(BOOST_INTERPROCESS_RV_REF(set) x)
- { m_tree = boost::interprocess::move(x.m_tree); return *this; }
+ set& operator=(BOOST_MOVE_MACRO_RV_REF(set) x)
+ { m_tree = BOOST_CONTAINER_MOVE_NAMESPACE::move(x.m_tree); return *this; }
 
    //! <b>Effects</b>: Returns the comparison object out
    //! of which a was constructed.
@@ -357,12 +325,12 @@
    std::pair<iterator,bool> insert(insert_const_ref_type x)
    { return priv_insert(x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    std::pair<iterator,bool> insert(T &x)
    { return this->insert(const_cast<const T &>(x)); }
 
    template<class U>
- std::pair<iterator,bool> insert(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ std::pair<iterator,bool> insert(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return priv_insert(u); }
    #endif
 
@@ -374,8 +342,8 @@
    //! points to the element with key equivalent to the key of x.
    //!
    //! <b>Complexity</b>: Logarithmic.
- std::pair<iterator,bool> insert(BOOST_INTERPROCESS_RV_REF(value_type) x)
- { return m_tree.insert_unique(boost::interprocess::move(x)); }
+ std::pair<iterator,bool> insert(BOOST_MOVE_MACRO_RV_REF(value_type) x)
+ { return m_tree.insert_unique(BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Effects</b>: Inserts a copy of x in the container if and only if there is
    //! no element in the container with key equivalent to the key of x.
@@ -389,12 +357,12 @@
    iterator insert(const_iterator p, insert_const_ref_type x)
    { return priv_insert(p, x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    iterator insert(const_iterator position, T &x)
    { return this->insert(position, const_cast<const T &>(x)); }
 
    template<class U>
- iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return priv_insert(position, u); }
    #endif
 
@@ -404,8 +372,8 @@
    //! <b>Returns</b>: An iterator pointing to the element with key equivalent to the key of x.
    //!
    //! <b>Complexity</b>: Logarithmic.
- iterator insert(const_iterator p, BOOST_INTERPROCESS_RV_REF(value_type) x)
- { return m_tree.insert_unique(p, boost::interprocess::move(x)); }
+ iterator insert(const_iterator p, BOOST_MOVE_MACRO_RV_REF(value_type) x)
+ { return m_tree.insert_unique(p, BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Requires</b>: i, j are not iterators into *this.
    //!
@@ -431,7 +399,7 @@
    //! <b>Complexity</b>: Logarithmic.
    template <class... Args>
    iterator emplace(Args&&... args)
- { return m_tree.emplace_unique(boost::interprocess::forward<Args>(args)...); }
+ { return m_tree.emplace_unique(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    //! <b>Effects</b>: Inserts an object of type T constructed with
    //! std::forward<Args>(args)... if and only if there is
@@ -444,7 +412,7 @@
    //! <b>Complexity</b>: Logarithmic.
    template <class... Args>
    iterator emplace_hint(const_iterator hint, Args&&... args)
- { return m_tree.emplace_hint_unique(hint, boost::interprocess::forward<Args>(args)...); }
+ { return m_tree.emplace_hint_unique(hint, BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    #else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
 
@@ -652,7 +620,7 @@
 {
    /// @cond
    private:
- BOOST_COPYABLE_AND_MOVABLE(multiset)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(multiset)
    typedef containers_detail::rbtree<T, T,
                      containers_detail::identity<T>, Pred, Alloc> tree_t;
    tree_t m_tree; // red-black tree representing multiset
@@ -727,21 +695,21 @@
    //! <b>Complexity</b>: Construct.
    //!
    //! <b>Postcondition</b>: x is emptied.
- multiset(BOOST_INTERPROCESS_RV_REF(multiset) x)
- : m_tree(boost::interprocess::move(x.m_tree))
+ multiset(BOOST_MOVE_MACRO_RV_REF(multiset) x)
+ : m_tree(BOOST_CONTAINER_MOVE_NAMESPACE::move(x.m_tree))
    {}
 
    //! <b>Effects</b>: Makes *this a copy of x.
    //!
    //! <b>Complexity</b>: Linear in x.size().
- multiset& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(multiset) x)
+ multiset& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(multiset) x)
    { m_tree = x.m_tree; return *this; }
 
    //! <b>Effects</b>: this->swap(x.get()).
    //!
    //! <b>Complexity</b>: Constant.
- multiset& operator=(BOOST_INTERPROCESS_RV_REF(multiset) x)
- { m_tree = boost::interprocess::move(x.m_tree); return *this; }
+ multiset& operator=(BOOST_MOVE_MACRO_RV_REF(multiset) x)
+ { m_tree = BOOST_CONTAINER_MOVE_NAMESPACE::move(x.m_tree); return *this; }
 
    //! <b>Effects</b>: Returns the comparison object out
    //! of which a was constructed.
@@ -912,12 +880,12 @@
    iterator insert(insert_const_ref_type x)
    { return priv_insert(x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    iterator insert(T &x)
    { return this->insert(const_cast<const T &>(x)); }
 
    template<class U>
- iterator insert(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ iterator insert(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return priv_insert(u); }
    #endif
 
@@ -928,8 +896,8 @@
    //!
    //! <b>Complexity</b>: Logarithmic in general, but amortized constant if t
    //! is inserted right before p.
- iterator insert(BOOST_INTERPROCESS_RV_REF(value_type) x)
- { return m_tree.insert_equal(boost::interprocess::move(x)); }
+ iterator insert(BOOST_MOVE_MACRO_RV_REF(value_type) x)
+ { return m_tree.insert_equal(BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Effects</b>: Inserts a copy of x in the container.
    //! p is a hint pointing to where the insert should start to search.
@@ -942,12 +910,12 @@
    iterator insert(const_iterator p, insert_const_ref_type x)
    { return priv_insert(p, x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    iterator insert(const_iterator position, T &x)
    { return this->insert(position, const_cast<const T &>(x)); }
 
    template<class U>
- iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return priv_insert(position, u); }
    #endif
 
@@ -959,8 +927,8 @@
    //!
    //! <b>Complexity</b>: Logarithmic in general, but amortized constant if t
    //! is inserted right before p.
- iterator insert(const_iterator p, BOOST_INTERPROCESS_RV_REF(value_type) x)
- { return m_tree.insert_equal(p, boost::interprocess::move(x)); }
+ iterator insert(const_iterator p, BOOST_MOVE_MACRO_RV_REF(value_type) x)
+ { return m_tree.insert_equal(p, BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Requires</b>: i, j are not iterators into *this.
    //!
@@ -980,7 +948,7 @@
    //! <b>Complexity</b>: Logarithmic.
    template <class... Args>
    iterator emplace(Args&&... args)
- { return m_tree.emplace_equal(boost::interprocess::forward<Args>(args)...); }
+ { return m_tree.emplace_equal(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    //! <b>Effects</b>: Inserts an object of type T constructed with
    //! std::forward<Args>(args)...
@@ -992,7 +960,7 @@
    //! is inserted right before p.
    template <class... Args>
    iterator emplace_hint(const_iterator hint, Args&&... args)
- { return m_tree.emplace_hint_equal(hint, boost::interprocess::forward<Args>(args)...); }
+ { return m_tree.emplace_hint_equal(hint, BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    #else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
 
@@ -1181,7 +1149,7 @@
 
 }}
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif /* BOOST_CONTAINERS_SET_HPP */
 

Modified: branches/release/boost/interprocess/containers/container/slist.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/slist.hpp (original)
+++ branches/release/boost/interprocess/containers/container/slist.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -7,38 +7,6 @@
 // See http://www.boost.org/libs/container for documentation.
 //
 //////////////////////////////////////////////////////////////////////////////
-//
-// This file comes from SGI's stl_slist.h file. Modified by Ion Gaztanaga 2004-2009
-// Renaming, isolating and porting to generic algorithms. Pointer typedef
-// set to allocator::pointer to allow placing it in shared memory.
-//
-///////////////////////////////////////////////////////////////////////////////
-/*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
- * Copyright (c) 1996
- * Silicon Graphics Computer Systems, Inc.
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
 
 #ifndef BOOST_CONTAINERS_SLIST_HPP
 #define BOOST_CONTAINERS_SLIST_HPP
@@ -47,24 +15,24 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
 
-#include <boost/interprocess/containers/container/container_fwd.hpp>
-#include <boost/interprocess/detail/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 #include <boost/pointer_to_other.hpp>
-#include <boost/interprocess/containers/container/detail/utilities.hpp>
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
 #include <boost/type_traits/has_trivial_destructor.hpp>
 #include <boost/detail/no_exceptions_support.hpp>
-#include <boost/interprocess/containers/container/detail/node_alloc_holder.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_NODE_ALLOC_HOLDER_HPP
 #include <boost/intrusive/slist.hpp>
 
 
 #if defined(BOOST_CONTAINERS_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
 //Preprocessor library to emulate perfect forwarding
 #else
-#include <boost/interprocess/containers/container/detail/preprocessor.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
 #endif
 
 #include <stdexcept>
@@ -105,7 +73,7 @@
 
    template<class ...Args>
    slist_node(Args &&...args)
- : m_data(boost::interprocess::forward<Args>(args)...)
+ : m_data(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...)
    {}
 
    #else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -254,7 +222,7 @@
 
    /// @cond
    private:
- BOOST_COPYABLE_AND_MOVABLE(slist)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(slist)
    typedef difference_type list_difference_type;
    typedef pointer list_pointer;
    typedef const_pointer list_const_pointer;
@@ -404,8 +372,8 @@
    //! <b>Throws</b>: If allocator_type's copy constructor throws.
    //!
    //! <b>Complexity</b>: Constant.
- slist(BOOST_INTERPROCESS_RV_REF(slist) x)
- : AllocHolder(boost::interprocess::move((AllocHolder&)x))
+ slist(BOOST_MOVE_MACRO_RV_REF(slist) x)
+ : AllocHolder(BOOST_CONTAINER_MOVE_NAMESPACE::move((AllocHolder&)x))
    {}
 
    //! <b>Effects</b>: Makes *this contain the same elements as x.
@@ -416,7 +384,7 @@
    //! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
    //!
    //! <b>Complexity</b>: Linear to the number of elements in x.
- slist& operator= (BOOST_INTERPROCESS_COPY_ASSIGN_REF(slist) x)
+ slist& operator= (BOOST_MOVE_MACRO_COPY_ASSIGN_REF(slist) x)
    {
       if (&x != this){
          this->assign(x.begin(), x.end());
@@ -432,7 +400,7 @@
    //! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
    //!
    //! <b>Complexity</b>: Linear to the number of elements in x.
- slist& operator= (BOOST_INTERPROCESS_RV_REF(slist) mx)
+ slist& operator= (BOOST_MOVE_MACRO_RV_REF(slist) mx)
    {
       if (&mx != this){
          this->clear();
@@ -631,11 +599,11 @@
    void push_front(insert_const_ref_type x)
    { return priv_push_front(x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    void push_front(T &x) { push_front(const_cast<const T &>(x)); }
 
    template<class U>
- void push_front(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ void push_front(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return priv_push_front(u); }
    #endif
 
@@ -645,8 +613,8 @@
    //! <b>Throws</b>: If memory allocation throws.
    //!
    //! <b>Complexity</b>: Amortized constant time.
- void push_front(BOOST_INTERPROCESS_RV_REF(T) x)
- { this->icont().push_front(*this->create_node(boost::interprocess::move(x))); }
+ void push_front(BOOST_MOVE_MACRO_RV_REF(T) x)
+ { this->icont().push_front(*this->create_node(BOOST_CONTAINER_MOVE_NAMESPACE::move(x))); }
 
    //! <b>Effects</b>: Removes the first element from the list.
    //!
@@ -692,12 +660,12 @@
    iterator insert_after(const_iterator prev_pos, insert_const_ref_type x)
    { return this->priv_insert_after(prev_pos, x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    iterator insert_after(const_iterator position, T &x)
    { return this->insert_after(position, const_cast<const T &>(x)); }
 
    template<class U>
- iterator insert_after(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ iterator insert_after(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return this->priv_insert_after(position, u); }
    #endif
 
@@ -714,8 +682,8 @@
    //!
    //! <b>Note</b>: Does not affect the validity of iterators and references of
    //! previous values.
- iterator insert_after(const_iterator prev_pos, BOOST_INTERPROCESS_RV_REF(value_type) x)
- { return iterator(this->icont().insert_after(prev_pos.get(), *this->create_node(boost::interprocess::move(x)))); }
+ iterator insert_after(const_iterator prev_pos, BOOST_MOVE_MACRO_RV_REF(value_type) x)
+ { return iterator(this->icont().insert_after(prev_pos.get(), *this->create_node(BOOST_CONTAINER_MOVE_NAMESPACE::move(x)))); }
 
    //! <b>Requires</b>: prev_pos must be a valid iterator of *this.
    //!
@@ -760,12 +728,12 @@
    iterator insert(const_iterator position, insert_const_ref_type x)
    { return this->priv_insert(position, x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    iterator insert(const_iterator position, T &x)
    { return this->insert(position, const_cast<const T &>(x)); }
 
    template<class U>
- iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return this->priv_insert(position, u); }
    #endif
 
@@ -776,8 +744,8 @@
    //! <b>Throws</b>: If memory allocation throws.
    //!
    //! <b>Complexity</b>: Linear to the elements before p.
- iterator insert(const_iterator p, BOOST_INTERPROCESS_RV_REF(value_type) x)
- { return this->insert_after(previous(p), boost::interprocess::move(x)); }
+ iterator insert(const_iterator p, BOOST_MOVE_MACRO_RV_REF(value_type) x)
+ { return this->insert_after(previous(p), BOOST_CONTAINER_MOVE_NAMESPACE::move(x)); }
 
    //! <b>Requires</b>: p must be a valid iterator of *this.
    //!
@@ -813,7 +781,7 @@
    //! <b>Complexity</b>: Amortized constant time.
    template <class... Args>
    void emplace_front(Args&&... args)
- { this->emplace_after(this->cbefore_begin(), boost::interprocess::forward<Args>(args)...); }
+ { this->emplace_after(this->cbefore_begin(), BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    //! <b>Effects</b>: Inserts an object of type T constructed with
    //! std::forward<Args>(args)... before p
@@ -824,7 +792,7 @@
    //! <b>Complexity</b>: Linear to the elements before p
    template <class... Args>
    iterator emplace(const_iterator p, Args&&... args)
- { return this->emplace_after(this->previous(p), boost::interprocess::forward<Args>(args)...); }
+ { return this->emplace_after(this->previous(p), BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
 
    //! <b>Effects</b>: Inserts an object of type T constructed with
    //! std::forward<Args>(args)... after prev
@@ -837,7 +805,7 @@
    iterator emplace_after(const_iterator prev, Args&&... args)
    {
       typename AllocHolder::Deallocator d(AllocHolder::create_node_and_deallocator());
- new ((void*)containers_detail::get_pointer(d.get())) Node(boost::interprocess::forward<Args>(args)...);
+ new ((void*)containers_detail::get_pointer(d.get())) Node(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
       NodePtr node = d.get();
       d.release();
       return iterator(this->icont().insert_after(prev.get(), *node));
@@ -1370,7 +1338,7 @@
 
    template<class Integer>
    void priv_insert_dispatch(const_iterator prev, Integer n, Integer x, containers_detail::true_)
- { this->priv_create_and_insert_nodes(prev, n, x); }
+ { this->priv_create_and_insert_nodes(prev, (std::size_t)n, x); }
 
    void priv_fill_assign(size_type n, const T& val)
    {
@@ -1412,7 +1380,7 @@
 
    template <class Int>
    void priv_insert_after_range_dispatch(const_iterator prev_pos, Int n, Int x, containers_detail::true_)
- { this->priv_create_and_insert_nodes(prev_pos, n, x); }
+ { this->priv_create_and_insert_nodes(prev_pos, (std::size_t)n, x); }
 
    template <class InIter>
    void priv_insert_after_range_dispatch(const_iterator prev_pos, InIter first, InIter last, containers_detail::false_)
@@ -1559,6 +1527,6 @@
 
 ///@endcond
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif /* BOOST_CONTAINERS_SLIST_HPP */

Modified: branches/release/boost/interprocess/containers/container/stable_vector.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/stable_vector.hpp (original)
+++ branches/release/boost/interprocess/containers/container/stable_vector.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -22,18 +22,18 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
-#include <boost/interprocess/containers/container/container_fwd.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
 #include <boost/mpl/bool.hpp>
 #include <boost/mpl/not.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/type_traits/is_integral.hpp>
-#include <boost/interprocess/containers/container/detail/version_type.hpp>
-#include <boost/interprocess/containers/container/detail/multiallocation_chain.hpp>
-#include <boost/interprocess/containers/container/detail/utilities.hpp>
-#include <boost/interprocess/containers/container/detail/iterators.hpp>
-#include <boost/interprocess/containers/container/detail/algorithms.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MULTIALLOCATION_CHAIN_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ITERATORS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ALGORITHMS_HPP
 #include <boost/pointer_to_other.hpp>
 #include <boost/get_pointer.hpp>
 
@@ -46,7 +46,7 @@
 #define STABLE_VECTOR_USE_CONTAINERS_VECTOR
 
 #if defined (STABLE_VECTOR_USE_CONTAINERS_VECTOR)
-#include <boost/interprocess/containers/container/vector.hpp>
+#include INCLUDE_BOOST_CONTAINER_VECTOR_HPP
 #else
 #include <vector>
 #endif //STABLE_VECTOR_USE_CONTAINERS_VECTOR
@@ -140,7 +140,7 @@
 
    template<class ...Args>
    node_type(Args &&...args)
- : value(boost::interprocess::forward<Args>(args)...)
+ : value(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...)
    {}
 
    #else //BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -454,7 +454,7 @@
 
    ///@cond
    private:
- BOOST_COPYABLE_AND_MOVABLE(stable_vector)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(stable_vector)
    static const size_type ExtraPointers = 3;
    typedef typename stable_vector_detail::
       select_multiallocation_chain
@@ -508,7 +508,7 @@
       cod.release();
    }
 
- stable_vector(BOOST_INTERPROCESS_RV_REF(stable_vector) x)
+ stable_vector(BOOST_MOVE_MACRO_RV_REF(stable_vector) x)
       : internal_data(x.get_al()),impl(x.get_al())
    { this->swap(x); }
 
@@ -518,7 +518,7 @@
       clear_pool();
    }
 
- stable_vector& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(stable_vector) x)
+ stable_vector& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(stable_vector) x)
    {
       STABLE_VECTOR_CHECK_INVARIANT;
       if (this != &x) {
@@ -527,7 +527,7 @@
       return *this;
    }
 
- stable_vector& operator=(BOOST_INTERPROCESS_RV_REF(stable_vector) x)
+ stable_vector& operator=(BOOST_MOVE_MACRO_RV_REF(stable_vector) x)
    {
       if (&x != this){
          this->swap(x);
@@ -672,16 +672,16 @@
    void push_back(insert_const_ref_type x)
    { return priv_push_back(x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    void push_back(T &x) { push_back(const_cast<const T &>(x)); }
 
    template<class U>
- void push_back(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ void push_back(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return priv_push_back(u); }
    #endif
 
- void push_back(BOOST_INTERPROCESS_RV_REF(T) t)
- { this->insert(end(), boost::interprocess::move(t)); }
+ void push_back(BOOST_MOVE_MACRO_RV_REF(T) t)
+ { this->insert(end(), BOOST_CONTAINER_MOVE_NAMESPACE::move(t)); }
 
    void pop_back()
    { this->erase(this->end()-1); }
@@ -689,18 +689,18 @@
    iterator insert(const_iterator position, insert_const_ref_type x)
    { return this->priv_insert(position, x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    iterator insert(const_iterator position, T &x) { return this->insert(position, const_cast<const T &>(x)); }
 
    template<class U>
- iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return this->priv_insert(position, u); }
    #endif
 
- iterator insert(const_iterator position, BOOST_INTERPROCESS_RV_REF(T) x)
+ iterator insert(const_iterator position, BOOST_MOVE_MACRO_RV_REF(T) x)
    {
       typedef repeat_iterator<T, difference_type> repeat_it;
- typedef boost::interprocess::move_iterator<repeat_it> repeat_move_it;
+ typedef BOOST_CONTAINER_MOVE_NAMESPACE::move_iterator<repeat_it> repeat_move_it;
       //Just call more general insert(pos, size, value) and return iterator
       size_type pos_n = position - cbegin();
       this->insert(position
@@ -736,7 +736,7 @@
    {
       typedef emplace_functor<node_type_t, Args...> EmplaceFunctor;
       typedef emplace_iterator<node_type_t, EmplaceFunctor> EmplaceIterator;
- EmplaceFunctor &&ef = EmplaceFunctor(boost::interprocess::forward<Args>(args)...);
+ EmplaceFunctor &&ef = EmplaceFunctor(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
       this->insert(this->cend(), EmplaceIterator(ef), EmplaceIterator());
    }
 
@@ -756,7 +756,7 @@
       size_type pos_n = position - cbegin();
       typedef emplace_functor<node_type_t, Args...> EmplaceFunctor;
       typedef emplace_iterator<node_type_t, EmplaceFunctor> EmplaceIterator;
- EmplaceFunctor &&ef = EmplaceFunctor(boost::interprocess::forward<Args>(args)...);
+ EmplaceFunctor &&ef = EmplaceFunctor(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
       this->insert(position, EmplaceIterator(ef), EmplaceIterator());
       return iterator(this->begin() + pos_n);
    }
@@ -870,7 +870,7 @@
          void_ptr &p2 = impl.back();
          multiallocation_chain holder;
          holder.incorporate_after(holder.before_begin(), p1, p2, internal_data.pool_size);
- get_al().deallocate_individual(boost::interprocess::move(holder));
+ get_al().deallocate_individual(BOOST_CONTAINER_MOVE_NAMESPACE::move(holder));
          p1 = p2 = 0;
          this->internal_data.pool_size = 0;
       }
@@ -900,7 +900,7 @@
       void_ptr &p2 = impl.back();
       multiallocation_chain holder;
       holder.incorporate_after(holder.before_begin(), p1, p2, internal_data.pool_size);
- BOOST_STATIC_ASSERT((::boost::interprocess::is_movable<multiallocation_chain>::value == true));
+ BOOST_STATIC_ASSERT((::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<multiallocation_chain>::value == true));
       multiallocation_chain m (get_al().allocate_individual(n));
       holder.splice_after(holder.before_begin(), m, m.before_begin(), m.last(), n);
       this->internal_data.pool_size += n;
@@ -1169,7 +1169,7 @@
       }
       catch(...){
          get_al().deallocate_one(p);
- get_al().deallocate_many(boost::interprocess::move(mem));
+ get_al().deallocate_many(BOOST_CONTAINER_MOVE_NAMESPACE::move(mem));
          impl.erase(it+i, it+n);
          this->align_nodes(it+i,get_last_align());
          throw;
@@ -1324,6 +1324,6 @@
 
 }}
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif //BOOST_CONTAINER_STABLE_VECTOR_HPP

Modified: branches/release/boost/interprocess/containers/container/string.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/string.hpp (original)
+++ branches/release/boost/interprocess/containers/container/string.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -7,38 +7,22 @@
 // See http://www.boost.org/libs/container for documentation.
 //
 //////////////////////////////////////////////////////////////////////////////
-//
-// This file comes from SGI's string file. Modified by Ion Gaztanaga 2004-2009
-// Renaming, isolating and porting to generic algorithms. Pointer typedef
-// set to allocator::pointer to allow placing it in shared memory.
-//
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 1994
-// Hewlett-Packard Company
-//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appear in all copies and
-// that both that copyright notice and this permission notice appear
-// in supporting documentation. Hewlett-Packard Company makes no
-// representations about the suitability of this software for any
-// purpose. It is provided "as is" without express or implied warranty.
 
 #ifndef BOOST_CONTAINERS_STRING_HPP
 #define BOOST_CONTAINERS_STRING_HPP
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
 
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
-#include <boost/interprocess/containers/container/container_fwd.hpp>
-#include <boost/interprocess/containers/container/detail/utilities.hpp>
-#include <boost/interprocess/containers/container/detail/iterators.hpp>
-#include <boost/interprocess/containers/container/detail/algorithms.hpp>
-#include <boost/interprocess/containers/container/detail/version_type.hpp>
-#include <boost/interprocess/containers/container/detail/allocation_type.hpp>
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
-#include <boost/interprocess/detail/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ITERATORS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ALGORITHMS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ALLOCATION_TYPE_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 #include <boost/static_assert.hpp>
 
 #include <functional>
@@ -55,7 +39,7 @@
 #include <locale>
 #include <cstddef>
 #include <climits>
-#include <boost/interprocess/containers/container/detail/type_traits.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_TYPE_TRAITS_HPP
 #include <boost/detail/no_exceptions_support.hpp>
 #include <boost/type_traits/has_trivial_destructor.hpp>
 
@@ -83,7 +67,7 @@
 class basic_string_base
 {
    basic_string_base();
- BOOST_INTERPROCESS_MOVABLE_BUT_NOT_COPYABLE(basic_string_base)
+ BOOST_MOVE_MACRO_MOVABLE_BUT_NOT_COPYABLE(basic_string_base)
 
  public:
    typedef A allocator_type;
@@ -104,7 +88,7 @@
       this->allocate_initial_block(n);
    }
 
- basic_string_base(BOOST_INTERPROCESS_RV_REF(basic_string_base) b)
+ basic_string_base(BOOST_MOVE_MACRO_RV_REF(basic_string_base) b)
       : members_(b.members_)
    {
       init();
@@ -280,7 +264,7 @@
       (void)limit_size;
       (void)reuse;
       if(!(command & allocate_new))
- return std::pair<pointer, bool>(pointer(0), 0);
+ return std::pair<pointer, bool>(pointer(0), false);
       received_size = preferred_size;
       return std::make_pair(this->alloc().allocate(received_size), false);
    }
@@ -445,7 +429,7 @@
 {
    /// @cond
    private:
- BOOST_COPYABLE_AND_MOVABLE(basic_string)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(basic_string)
    typedef containers_detail::basic_string_base<A> base_t;
    static const typename base_t::size_type InternalBufferChars = base_t::InternalBufferChars;
 
@@ -551,8 +535,8 @@
    //! <b>Throws</b>: If allocator_type's copy constructor throws.
    //!
    //! <b>Complexity</b>: Constant.
- basic_string(BOOST_INTERPROCESS_RV_REF(basic_string) s)
- : base_t(boost::interprocess::move((base_t&)s))
+ basic_string(BOOST_MOVE_MACRO_RV_REF(basic_string) s)
+ : base_t(BOOST_CONTAINER_MOVE_NAMESPACE::move((base_t&)s))
    {}
 
    //! <b>Effects</b>: Constructs a basic_string taking the allocator as parameter,
@@ -618,7 +602,7 @@
    //! <b>Postcondition</b>: x == *this.
    //!
    //! <b>Complexity</b>: Linear to the elements x contains.
- basic_string& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(basic_string) s)
+ basic_string& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(basic_string) s)
    {
       if (&s != this)
          this->assign(s.begin(), s.end());
@@ -630,7 +614,7 @@
    //! <b>Throws</b>: If allocator_type's copy constructor throws.
    //!
    //! <b>Complexity</b>: Constant.
- basic_string& operator=(BOOST_INTERPROCESS_RV_REF(basic_string) ms)
+ basic_string& operator=(BOOST_MOVE_MACRO_RV_REF(basic_string) ms)
    {
       basic_string &s = ms;
       if (&s != this){
@@ -947,7 +931,7 @@
    { return this->operator=(s); }
 
    //! <b>Effects</b>: Moves the resources from ms *this.
- basic_string& assign(BOOST_INTERPROCESS_RV_REF(basic_string) ms)
+ basic_string& assign(BOOST_MOVE_MACRO_RV_REF(basic_string) ms)
    { return this->operator=(ms);}
 
    //! <b>Effects</b>: Assigns the range [pos, pos + n) from s to *this.
@@ -1916,19 +1900,19 @@
 }
 
 template <class CharT, class Traits, class A> inline
-BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
+BOOST_MOVE_MACRO_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
    operator+(
- BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A) mx
+ BOOST_MOVE_MACRO_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A) mx
    , const basic_string<CharT,Traits,A>& y)
 {
    mx += y;
- return boost::interprocess::move(mx);
+ return BOOST_CONTAINER_MOVE_NAMESPACE::move(mx);
 }
 
 template <class CharT, class Traits, class A> inline
-BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
+BOOST_MOVE_MACRO_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
    operator+(const basic_string<CharT,Traits,A>& x,
- BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A) my)
+ BOOST_MOVE_MACRO_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A) my)
 {
    typedef typename basic_string<CharT,Traits,A>::size_type size_type;
    return my.replace(size_type(0), size_type(0), x);
@@ -1949,12 +1933,12 @@
 }
 
 template <class CharT, class Traits, class A> inline
-BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
+BOOST_MOVE_MACRO_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
 operator+(const CharT* s,
- BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A) my)
+ BOOST_MOVE_MACRO_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A) my)
 {
    typedef typename basic_string<CharT,Traits,A>::size_type size_type;
- return boost::interprocess::move(my.get().replace(size_type(0), size_type(0), s));
+ return BOOST_CONTAINER_MOVE_NAMESPACE::move(my.get().replace(size_type(0), size_type(0), s));
 }
 
 template <class CharT, class Traits, class A>
@@ -1971,9 +1955,9 @@
 }
 
 template <class CharT, class Traits, class A> inline
-BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
+BOOST_MOVE_MACRO_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
 operator+(CharT c,
- BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A) my)
+ BOOST_MOVE_MACRO_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A) my)
 {
    typedef typename basic_string<CharT,Traits,A>::size_type size_type;
    return my.replace(size_type(0), size_type(0), &c, &c + 1);
@@ -1994,12 +1978,12 @@
 }
 
 template <class CharT, class Traits, class A>
-BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
-operator+(BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A) mx
+BOOST_MOVE_MACRO_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
+operator+(BOOST_MOVE_MACRO_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A) mx
          , const CharT* s)
 {
    mx += s;
- return boost::interprocess::move(mx);
+ return BOOST_CONTAINER_MOVE_NAMESPACE::move(mx);
 }
 
 template <class CharT, class Traits, class A>
@@ -2016,12 +2000,12 @@
 }
 
 template <class CharT, class Traits, class A>
-BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
-operator+( BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A) mx
+BOOST_MOVE_MACRO_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
+operator+( BOOST_MOVE_MACRO_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A) mx
          , const CharT c)
 {
    mx += c;
- return boost::interprocess::move(mx);
+ return BOOST_CONTAINER_MOVE_NAMESPACE::move(mx);
 }
 
 // Operator== and operator!=
@@ -2273,7 +2257,6 @@
       std::basic_streambuf<CharT, Traits>* buf = is.rdbuf();
       s.clear();
 
- int c1;
       while (nread < s.max_size()) {
          int c1 = buf->sbumpc();
          if (Traits::eq_int_type(c1, Traits::eof())) {
@@ -2327,6 +2310,6 @@
 
 /// @endcond
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif // BOOST_CONTAINERS_STRING_HPP

Modified: branches/release/boost/interprocess/containers/container/vector.hpp
==============================================================================
--- branches/release/boost/interprocess/containers/container/vector.hpp (original)
+++ branches/release/boost/interprocess/containers/container/vector.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -7,34 +7,6 @@
 // See http://www.boost.org/libs/container for documentation.
 //
 //////////////////////////////////////////////////////////////////////////////
-//
-// This file comes from SGI's stl_vector.h file. Modified by Ion Gaztanaga.
-// Renaming, isolating and porting to generic algorithms. Pointer typedef
-// set to allocator::pointer to allow placing it in shared memory.
-//
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 1994
-// Hewlett-Packard Company
-//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appear in all copies and
-// that both that copyright notice and this permission notice appear
-// in supporting documentation. Hewlett-Packard Company makes no
-// representations about the suitability of this software for any
-// purpose. It is provided "as is" without express or implied warranty.
-//
-//
-// Copyright (c) 1996
-// Silicon Graphics Computer Systems, Inc.
-//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appear in all copies and
-// that both that copyright notice and this permission notice appear
-// in supporting documentation. Silicon Graphics makes no
-// representations about the suitability of this software for any
-// purpose. It is provided "as is" without express or implied warranty.
 
 #ifndef BOOST_CONTAINERS_CONTAINERS_VECTOR_HPP
 #define BOOST_CONTAINERS_CONTAINERS_VECTOR_HPP
@@ -43,9 +15,9 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/containers/container/detail/config_begin.hpp>
-#include <boost/interprocess/containers/container/detail/workaround.hpp>
-#include <boost/interprocess/containers/container/container_fwd.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
 
 #include <cstddef>
 #include <memory>
@@ -59,17 +31,17 @@
 #include <boost/type_traits/has_trivial_assign.hpp>
 #include <boost/type_traits/has_nothrow_copy.hpp>
 #include <boost/type_traits/has_nothrow_assign.hpp>
-#include <boost/interprocess/containers/container/detail/version_type.hpp>
-#include <boost/interprocess/containers/container/detail/allocation_type.hpp>
-#include <boost/interprocess/containers/container/detail/utilities.hpp>
-#include <boost/interprocess/containers/container/detail/iterators.hpp>
-#include <boost/interprocess/containers/container/detail/algorithms.hpp>
-#include <boost/interprocess/containers/container/detail/destroyers.hpp>
-#include <boost/interprocess/containers/container/container_fwd.hpp>
-#include <boost/interprocess/detail/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ALLOCATION_TYPE_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_UTILITIES_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ITERATORS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ALGORITHMS_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_DESTROYERS_HPP
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
 #include <boost/pointer_to_other.hpp>
-#include <boost/interprocess/containers/container/detail/mpl.hpp>
-#include <boost/interprocess/containers/container/detail/advanced_insert_int.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_ADVANCED_INSERT_INT_HPP
 
 namespace boost {
 namespace container {
@@ -316,7 +288,7 @@
       (void)limit_size;
       (void)reuse;
       if(!(command & allocate_new))
- return std::pair<pointer, bool>(pointer(0), 0);
+ return std::pair<pointer, bool>(pointer(0), false);
       received_size = preferred_size;
       return std::make_pair(this->alloc().allocate(received_size), false);
    }
@@ -439,7 +411,7 @@
 
    /// @cond
    private:
- BOOST_COPYABLE_AND_MOVABLE(vector)
+ BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(vector)
    typedef containers_detail::advanced_insert_aux_int<T, T*> advanced_insert_aux_int_t;
    typedef containers_detail::vector_value_traits<value_type, A> value_traits;
 
@@ -449,7 +421,7 @@
 
    typedef constant_iterator<T, difference_type> cvalue_iterator;
    typedef repeat_iterator<T, difference_type> repeat_it;
- typedef boost::interprocess::move_iterator<repeat_it> repeat_move_it;
+ typedef BOOST_CONTAINER_MOVE_NAMESPACE::move_iterator<repeat_it> repeat_move_it;
    /// @endcond
 
    public:
@@ -499,7 +471,7 @@
    //! <b>Throws</b>: If allocator_type's copy constructor throws.
    //!
    //! <b>Complexity</b>: Constant.
- vector(BOOST_INTERPROCESS_RV_REF(vector) mx)
+ vector(BOOST_MOVE_MACRO_RV_REF(vector) mx)
       : base_t(static_cast<base_t&>(mx).alloc())
    { this->swap(mx); }
 
@@ -808,8 +780,8 @@
          else{
             //We will reuse insert code, so create a dummy input iterator
             T *dummy_it(containers_detail::get_pointer(this->members_.m_start));
- containers_detail::advanced_insert_aux_proxy<T, boost::interprocess::move_iterator<T*>, T*>
- proxy(::boost::interprocess::make_move_iterator(dummy_it), ::boost::interprocess::make_move_iterator(dummy_it));
+ containers_detail::advanced_insert_aux_proxy<T, BOOST_CONTAINER_MOVE_NAMESPACE::move_iterator<T*>, T*>
+ proxy(::BOOST_CONTAINER_MOVE_NAMESPACE::make_move_iterator(dummy_it), ::BOOST_CONTAINER_MOVE_NAMESPACE::make_move_iterator(dummy_it));
             //Backwards (and possibly forward) expansion
             if(ret.second){
                #ifdef BOOST_CONTAINERS_VECTOR_ALLOC_STATS
@@ -846,7 +818,7 @@
    //! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
    //!
    //! <b>Complexity</b>: Linear to the number of elements in x.
- vector& operator=(BOOST_INTERPROCESS_COPY_ASSIGN_REF(vector) x)
+ vector& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(vector) x)
    {
       if (&x != this){
          this->assign(x.members_.m_start, x.members_.m_start + x.members_.m_size);
@@ -862,7 +834,7 @@
    //! <b>Throws</b>: If allocator_type's copy constructor throws.
    //!
    //! <b>Complexity</b>: Linear.
- vector& operator=(BOOST_INTERPROCESS_RV_REF(vector) x)
+ vector& operator=(BOOST_MOVE_MACRO_RV_REF(vector) x)
    {
       if (&x != this){
          this->swap(x);
@@ -903,11 +875,14 @@
    void push_back(insert_const_ref_type x)
    { return priv_push_back(x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    void push_back(T &x) { push_back(const_cast<const T &>(x)); }
 
    template<class U>
- void push_back(const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ void push_back(const U &u, typename containers_detail::enable_if_c
+ <containers_detail::is_same<T, U>::value &&
+ !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value
+ >::type* =0)
    { return priv_push_back(u); }
    #endif
 
@@ -917,15 +892,15 @@
    //! <b>Throws</b>: If memory allocation throws.
    //!
    //! <b>Complexity</b>: Amortized constant time.
- void push_back(BOOST_INTERPROCESS_RV_REF(T) x)
+ void push_back(BOOST_MOVE_MACRO_RV_REF(T) x)
    {
       if (this->members_.m_size < this->members_.m_capacity){
          //There is more memory, just construct a new object at the end
- new((void*)containers_detail::get_pointer(this->members_.m_start + this->members_.m_size))value_type(boost::interprocess::move(x));
+ new((void*)containers_detail::get_pointer(this->members_.m_start + this->members_.m_size))value_type(BOOST_CONTAINER_MOVE_NAMESPACE::move(x));
          ++this->members_.m_size;
       }
       else{
- this->insert(this->cend(), boost::interprocess::move(x));
+ this->insert(this->cend(), BOOST_CONTAINER_MOVE_NAMESPACE::move(x));
       }
    }
 
@@ -943,12 +918,12 @@
       T* back_pos = containers_detail::get_pointer(this->members_.m_start) + this->members_.m_size;
       if (this->members_.m_size < this->members_.m_capacity){
          //There is more memory, just construct a new object at the end
- new((void*)(back_pos))value_type(boost::interprocess::forward<Args>(args)...);
+ new((void*)(back_pos))value_type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
          ++this->members_.m_size;
       }
       else{
          typedef containers_detail::advanced_insert_aux_emplace<T, T*, Args...> type;
- type &&proxy = type(boost::interprocess::forward<Args>(args)...);
+ type &&proxy = type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
          priv_range_insert(back_pos, 1, proxy);
       }
    }
@@ -968,7 +943,7 @@
       //Just call more general insert(pos, size, value) and return iterator
       size_type pos_n = position - cbegin();
       typedef containers_detail::advanced_insert_aux_emplace<T, T*, Args...> type;
- type &&proxy = type(boost::interprocess::forward<Args>(args)...);
+ type &&proxy = type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
       priv_range_insert(position.get_ptr(), 1, proxy);
       return iterator(this->members_.m_start + pos_n);
    }
@@ -1062,11 +1037,11 @@
    iterator insert(const_iterator position, insert_const_ref_type x)
    { return this->priv_insert(position, x); }
 
- #if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
    iterator insert(const_iterator position, T &x) { return this->insert(position, const_cast<const T &>(x)); }
 
    template<class U>
- iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::boost::interprocess::is_movable<U>::value >::type* =0)
+ iterator insert(const_iterator position, const U &u, typename containers_detail::enable_if_c<containers_detail::is_same<T, U>::value && !::BOOST_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
    { return this->priv_insert(position, u); }
    #endif
 
@@ -1078,7 +1053,7 @@
    //!
    //! <b>Complexity</b>: If position is end(), amortized constant time
    //! Linear time otherwise.
- iterator insert(const_iterator position, BOOST_INTERPROCESS_RV_REF(T) x)
+ iterator insert(const_iterator position, BOOST_MOVE_MACRO_RV_REF(T) x)
    {
       //Just call more general insert(pos, size, value) and return iterator
       size_type pos_n = position - cbegin();
@@ -1137,7 +1112,7 @@
    {
       T *pos = containers_detail::get_pointer(position.get_ptr());
       T *beg = containers_detail::get_pointer(this->members_.m_start);
- boost::interprocess::move(pos + 1, beg + this->members_.m_size, pos);
+ BOOST_CONTAINER_MOVE_NAMESPACE::move(pos + 1, beg + this->members_.m_size, pos);
       --this->members_.m_size;
       //Destroy last element
       base_t::destroy(containers_detail::get_pointer(this->members_.m_start) + this->members_.m_size);
@@ -1153,7 +1128,7 @@
    {
       if (first != last){ // worth doing, copy down over hole
          T* end_pos = containers_detail::get_pointer(this->members_.m_start) + this->members_.m_size;
- T* ptr = containers_detail::get_pointer(boost::interprocess::move
+ T* ptr = containers_detail::get_pointer(BOOST_CONTAINER_MOVE_NAMESPACE::move
             (containers_detail::get_pointer(last.get_ptr())
             ,end_pos
             ,containers_detail::get_pointer(first.get_ptr())
@@ -1360,10 +1335,10 @@
       if (elems_after > n){
          //New elements can be just copied.
          //Move to uninitialized memory last objects
- ::boost::interprocess::uninitialized_move(old_finish - n, old_finish, old_finish);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move(old_finish - n, old_finish, old_finish);
          this->members_.m_size += n;
          //Copy previous to last objects to the initialized end
- boost::interprocess::move_backward(pos, old_finish - n, old_finish);
+ BOOST_CONTAINER_MOVE_NAMESPACE::move_backward(pos, old_finish - n, old_finish);
          //Insert new objects in the pos
          interf.copy_all_to(pos);
       }
@@ -1373,7 +1348,7 @@
          interf.uninitialized_copy_some_and_update(old_finish, elems_after, false);
          this->members_.m_size += n - elems_after;
          //Copy old [pos, end()) elements to the uninitialized memory
- ::boost::interprocess::uninitialized_move
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move
             ( pos, old_finish, containers_detail::get_pointer(this->members_.m_start) + this->members_.m_size);
          this->members_.m_size += elems_after;
          //Copy first new elements in pos
@@ -1395,7 +1370,7 @@
       //the start of the new buffer
       T *old_buffer = containers_detail::get_pointer(this->members_.m_start);
       if(old_buffer){
- new_finish = ::boost::interprocess::uninitialized_move
+ new_finish = ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move
             (containers_detail::get_pointer(this->members_.m_start), pos, old_finish = new_finish);
          constructed_values_destroyer.increment_size(new_finish - old_finish);
       }
@@ -1406,7 +1381,7 @@
       //Initialize from the rest of the old buffer,
       //starting from previous point
       if(old_buffer){
- new_finish = ::boost::interprocess::uninitialized_move
+ new_finish = ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move
             (pos, old_buffer + this->members_.m_size, new_finish);
          //Destroy and deallocate old elements
          //If there is allocated memory, destroy and deallocate
@@ -1447,7 +1422,7 @@
       //Check if s_before is big enough to hold the beginning of old data + new data
       if(difference_type(s_before) >= difference_type(elemsbefore + n)){
          //Copy first old values before pos, after that the new objects
- ::boost::interprocess::uninitialized_move(old_start, pos, new_start);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move(old_start, pos, new_start);
          this->members_.m_size = elemsbefore;
          interf.uninitialized_copy_all_to(new_start + elemsbefore);
          this->members_.m_size += n;
@@ -1465,7 +1440,7 @@
             //|___________|__________|_________|________________________|
             //
             //Now initialize the rest of memory with the last old values
- ::boost::interprocess::uninitialized_move
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move
                (pos, old_finish, new_start + elemsbefore + n);
             //All new elements correctly constructed, avoid new element destruction
             this->members_.m_size = old_size + n;
@@ -1492,13 +1467,13 @@
             size_type raw_gap = s_before - (elemsbefore + n);
             //Now initialize the rest of s_before memory with the
             //first of elements after new values
- ::boost::interprocess::uninitialized_move(pos, pos + raw_gap, new_start + elemsbefore + n);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move(pos, pos + raw_gap, new_start + elemsbefore + n);
             //Update size since we have a contiguous buffer
             this->members_.m_size = old_size + s_before;
             //All new elements correctly constructed, avoid old element destruction
             old_values_destroyer.release();
             //Now copy remaining last objects in the old buffer begin
- T *to_destroy = boost::interprocess::move(pos + raw_gap, old_finish, old_start);
+ T *to_destroy = BOOST_CONTAINER_MOVE_NAMESPACE::move(pos + raw_gap, old_finish, old_start);
             //Now destroy redundant elements except if they were moved and
             //they have trivial destructor after move
             size_type n_destroy = old_finish - to_destroy;
@@ -1557,13 +1532,13 @@
             //
             //Copy the first part of old_begin to raw_mem
             T *start_n = old_start + difference_type(s_before);
- ::boost::interprocess::uninitialized_move(old_start, start_n, new_start);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move(old_start, start_n, new_start);
             //The buffer is all constructed until old_end,
             //release destroyer and update size
             old_values_destroyer.release();
             this->members_.m_size = old_size + s_before;
             //Now copy the second part of old_begin overwriting himself
- T* next = boost::interprocess::move(start_n, pos, old_start);
+ T* next = BOOST_CONTAINER_MOVE_NAMESPACE::move(start_n, pos, old_start);
             if(do_after){
                //Now copy the new_beg elements
                interf.copy_some_and_update(next, s_before, true);
@@ -1573,7 +1548,7 @@
                interf.copy_all_to(next);
                T* move_start = next + n;
                //Now displace old_end elements
- T* move_end = boost::interprocess::move(pos, old_finish, move_start);
+ T* move_end = BOOST_CONTAINER_MOVE_NAMESPACE::move(pos, old_finish, move_start);
                //Destroy remaining moved elements from old_end except if
                //they have trivial destructor after being moved
                difference_type n_destroy = s_before - n;
@@ -1609,7 +1584,7 @@
             //|___________|_____|_________|__________________________|
             //
             //First copy whole old_begin and part of new to raw_mem
- ::boost::interprocess::uninitialized_move(old_start, pos, new_start);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move(old_start, pos, new_start);
             this->members_.m_size = elemsbefore;
 
             const size_type mid_n = difference_type(s_before) - elemsbefore;
@@ -1628,7 +1603,7 @@
                interf.copy_all_to(old_start);
                T* move_start = old_start + (n-mid_n);
                //Displace old_end
- T* move_end = boost::interprocess::move(pos, old_finish, move_start);
+ T* move_end = BOOST_CONTAINER_MOVE_NAMESPACE::move(pos, old_finish, move_start);
                //Destroy remaining moved elements from old_end except if they
                //have trivial destructor after being moved
                difference_type n_destroy = s_before - n;
@@ -1679,10 +1654,10 @@
                //
                //First copy the part of old_end raw_mem
                T* finish_n = old_finish - difference_type(n_after);
- ::boost::interprocess::uninitialized_move(finish_n, old_finish, old_finish);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move(finish_n, old_finish, old_finish);
                this->members_.m_size += n_after;
                //Displace the rest of old_end to the new position
- boost::interprocess::move_backward(pos, finish_n, old_finish);
+ BOOST_CONTAINER_MOVE_NAMESPACE::move_backward(pos, finish_n, old_finish);
                //Now overwrite with new_end
                //The new_end part is [first + (n - n_after), last)
                interf.copy_all_to(pos);
@@ -1705,7 +1680,7 @@
                //The new_end part is [first + (n - n_after), last)
                interf.uninitialized_copy_some_and_update(old_finish, elemsafter, false);
                this->members_.m_size += mid_last_dist;
- ::boost::interprocess::uninitialized_move(pos, old_finish, old_finish + mid_last_dist);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_move(pos, old_finish, old_finish + mid_last_dist);
                this->members_.m_size += n_after - mid_last_dist;
                //Now copy the part of new_end over constructed elements
                interf.copy_all_to(pos);
@@ -1718,7 +1693,7 @@
    void priv_range_insert(const_iterator pos, InIt first, InIt last, std::input_iterator_tag)
    {
       for(;first != last; ++first){
- this->insert(pos, boost::interprocess::move(value_type(*first)));
+ this->insert(pos, BOOST_CONTAINER_MOVE_NAMESPACE::move(value_type(*first)));
       }
    }
 
@@ -1789,14 +1764,14 @@
             T *end = std::copy(first, mid, start);
             //Initialize the remaining new elements in the uninitialized memory
             // iG std::uninitialized_copy(mid, last, end);
- ::boost::interprocess::uninitialized_copy_or_move(mid, last, end);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_copy_or_move(mid, last, end);
             this->members_.m_size = n;
          }
       }
       else if(!ret.second){
          typename value_traits::UCopiedArrayDeallocator scoped_alloc(ret.first, this->alloc(), real_cap);
          // iG std::uninitialized_copy(first, last, containers_detail::get_pointer(ret.first));
- ::boost::interprocess::uninitialized_copy_or_move(first, last, containers_detail::get_pointer(ret.first));
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_copy_or_move(first, last, containers_detail::get_pointer(ret.first));
          scoped_alloc.release();
          //Destroy and deallocate old buffer
          if(this->members_.m_start != 0){
@@ -1826,7 +1801,7 @@
          FwdIt mid = first;
          std::advance(mid, first_count);
          // iG std::uninitialized_copy(first, mid, containers_detail::get_pointer(ret.first));
- ::boost::interprocess::uninitialized_copy_or_move(first, mid, containers_detail::get_pointer(ret.first));
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_copy_or_move(first, mid, containers_detail::get_pointer(ret.first));
 
          if(old_offset > n){
             //All old elements will be destroyed by "old_values_destroyer"
@@ -1864,7 +1839,7 @@
 
    template <class Integer>
    void priv_assign_dispatch(Integer n, Integer val, containers_detail::true_)
- { this->assign((size_type) n, (T) val); }
+ { this->assign((size_type) n, (value_type)val); }
 
    template <class InIt>
    void priv_assign_dispatch(InIt first, InIt last, containers_detail::false_)
@@ -1955,7 +1930,7 @@
 
 /// @endcond
 
-#include <boost/interprocess/containers/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
 
 #endif // #ifndef BOOST_CONTAINERS_CONTAINERS_VECTOR_HPP
 

Modified: branches/release/boost/interprocess/creation_tags.hpp
==============================================================================
--- branches/release/boost/interprocess/creation_tags.hpp (original)
+++ branches/release/boost/interprocess/creation_tags.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -30,6 +30,10 @@
 struct open_read_only_t {};
 
 //!Tag to indicate that the resource must
+//!be only opened privately for reading
+struct open_read_private_t {};
+
+//!Tag to indicate that the resource must
 //!be only opened for reading
 struct open_copy_on_write_t {};
 

Modified: branches/release/boost/interprocess/detail/atomic.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/atomic.hpp (original)
+++ branches/release/boost/interprocess/detail/atomic.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -22,7 +22,7 @@
 namespace interprocess{
 namespace detail{
 
-//! Atomically increment an apr_uint32_t by 1
+//! Atomically increment an boost::uint32_t by 1
 //! "mem": pointer to the object
 //! Returns the old value pointed to by mem
 inline boost::uint32_t atomic_inc32(volatile boost::uint32_t *mem);

Modified: branches/release/boost/interprocess/detail/file_wrapper.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/file_wrapper.hpp (original)
+++ branches/release/boost/interprocess/detail/file_wrapper.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -35,19 +35,19 @@
 
    //!Creates a file object with name "name" and mode "mode", with the access mode "mode"
    //!If the file previously exists, throws an error.
- file_wrapper(create_only_t, const char *name, mode_t mode)
- { this->priv_open_or_create(detail::DoCreate, name, mode); }
+ file_wrapper(create_only_t, const char *name, mode_t mode, const permissions &perm = permissions())
+ { this->priv_open_or_create(detail::DoCreate, name, mode, perm); }
 
    //!Tries to create a file with name "name" and mode "mode", with the
    //!access mode "mode". If the file previously exists, it tries to open it with mode "mode".
    //!Otherwise throws an error.
- file_wrapper(open_or_create_t, const char *name, mode_t mode)
- { this->priv_open_or_create(detail::DoOpenOrCreate, name, mode); }
+ file_wrapper(open_or_create_t, const char *name, mode_t mode, const permissions &perm = permissions())
+ { this->priv_open_or_create(detail::DoOpenOrCreate, name, mode, perm); }
 
    //!Tries to open a file with name "name", with the access mode "mode".
    //!If the file does not previously exist, it throws an error.
    file_wrapper(open_only_t, const char *name, mode_t mode)
- { this->priv_open_or_create(detail::DoOpen, name, mode); }
+ { this->priv_open_or_create(detail::DoOpen, name, mode, permissions()); }
 
    //!Moves the ownership of "moved"'s file to *this.
    //!After the call, "moved" does not represent any file.
@@ -100,7 +100,7 @@
    //!Closes a previously opened file mapping. Never throws.
    void priv_close();
    //!Closes a previously opened file mapping. Never throws.
- bool priv_open_or_create(detail::create_enum_t type, const char *filename, mode_t mode);
+ bool priv_open_or_create(detail::create_enum_t type, const char *filename, mode_t mode, const permissions &perm);
 
    file_handle_t m_handle;
    mode_t m_mode;
@@ -136,7 +136,8 @@
 inline bool file_wrapper::priv_open_or_create
    (detail::create_enum_t type,
     const char *filename,
- mode_t mode)
+ mode_t mode,
+ const permissions &perm = permissions())
 {
    m_filename = filename;
 
@@ -151,10 +152,10 @@
          m_handle = open_existing_file(filename, mode);
       break;
       case detail::DoCreate:
- m_handle = create_new_file(filename, mode);
+ m_handle = create_new_file(filename, mode, perm);
       break;
       case detail::DoOpenOrCreate:
- m_handle = create_or_open_file(filename, mode);
+ m_handle = create_or_open_file(filename, mode, perm);
       break;
       default:
          {

Modified: branches/release/boost/interprocess/detail/intermodule_singleton.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/intermodule_singleton.hpp (original)
+++ branches/release/boost/interprocess/detail/intermodule_singleton.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -1,10 +1,3 @@
-/* Copyright 2006-2009 Joaquin M Lopez Munoz.
- * Distributed under the Boost Software License, Version 1.0.
- * (See accompanying file LICENSE_1_0.txt or copy at
- * http://www.boost.org/LICENSE_1_0.txt)
- *
- * See http://www.boost.org/libs/flyweight for library home page.
- */
 //////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Ion Gaztanaga 2009-2009. Distributed under the Boost
@@ -15,7 +8,6 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
-
 #ifndef BOOST_INTERPROCESS_INTERMODULE_SINGLETON_HPP
 #define BOOST_INTERPROCESS_INTERMODULE_SINGLETON_HPP
 
@@ -24,137 +16,1022 @@
 #endif
 
 #include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+
+#include <boost/interprocess/managed_shared_memory.hpp>
+#include <boost/interprocess/detail/atomic.hpp>
+#include <boost/interprocess/detail/os_thread_functions.hpp>
 #include <boost/interprocess/managed_shared_memory.hpp>
+#include <boost/interprocess/detail/tmp_dir_helpers.hpp>
+#include <boost/interprocess/detail/os_file_functions.hpp>
+#include <boost/interprocess/detail/mpl.hpp>
+#include <boost/assert.hpp>
+#include <cstddef>
+#include <cstdio>
+#include <cstring>
+#include <string>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+
+#if (defined BOOST_INTERPROCESS_WINDOWS)
+#include <fcntl.h>
+#include <io.h>
+
+#include <sys/locking.h>
+#else
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#endif
 
 namespace boost{
 namespace interprocess{
 namespace detail{
 
-const char *get_singleton_unique_name()
-{ return "unique_name";
+namespace file_locking_helpers {
 
-template<typename C>
-struct atomic_functor
+inline void get_pid_creation_time_str(std::string &s)
 {
- atomic_functor(managed_shared_memory &seg)
- : seg_(seg)
- {}
+ std::stringstream stream;
+ stream << get_current_process_id() << '_';
+ stream.precision(6);
+ stream << std::fixed << get_current_process_creation_time();
+ s = stream.str();
+}
 
- inline void operator()()
- {
- referenced_instance**pptr = seg.find_or_construct<referenced_instance*>(unique_instance)();
- detail::atomic_cas32(
+inline void create_tmp_subdir_and_get_pid_based_filepath(const char *subdir_name, const char *file_prefix, OS_process_id_t pid, std::string &s, bool creation_time = false)
+{
+ //Let's create a lock file for each process gmem that will mark if
+ //the process is alive or not
+ create_tmp_and_clean_old(s);
+ s += "/";
+ s += subdir_name;
+ if(!open_or_create_directory(s.c_str())){
+ throw interprocess_exception(error_info(system_error_code()));
+ }
+ s += "/";
+ s += file_prefix;
+ if(creation_time){
+ std::string sstamp;
+ get_pid_creation_time_str(sstamp);
+ s += sstamp;
+ }
+ else{
+ pid_str_t pid_str;
+ get_pid_str(pid_str, pid);
+ s += pid_str;
+ }
+}
+
+inline bool check_if_filename_complies_with_pid
+ (const char *filename, const char *prefix, OS_process_id_t pid, std::string &file_suffix, bool creation_time = false)
+{
+ //Check if filename complies with lock file name pattern
+ std::string fname(filename);
+ std::string fprefix(prefix);
+ if(fname.size() <= fprefix.size()){
+ return false;
+ }
+ fname.resize(fprefix.size());
+ if(fname != fprefix){
+ return false;
+ }
+
+ //If not our lock file, delete it if we can lock it
+ fname = filename;
+ fname.erase(0, fprefix.size());
+ pid_str_t pid_str;
+ get_pid_str(pid_str, pid);
+ file_suffix = pid_str;
+ if(creation_time){
+ std::size_t p = fname.find('_');
+ if (p == std::string::npos){
+ return false;
+ }
+ std::string save_suffix(fname);
+ fname.erase(p);
+ fname.swap(file_suffix);
+ bool ret = (file_suffix == fname);
+ file_suffix.swap(save_suffix);
+ return ret;
+ }
+ else{
+ fname.swap(file_suffix);
+ return (file_suffix == fname);
+ }
+}
+
+} //file_locking_helpers
+
+namespace intermodule_singleton_helpers {
+
+const int GMemMarkToBeRemoved = -1;
+const int GMemNotPresent = -2;
+
+inline const char *get_lock_file_subdir_name()
+{ return "gmem"; }
+
+inline const char *get_lock_file_base_name()
+{ return "lck"; }
+
+inline void create_and_get_singleton_lock_file_path(std::string &s)
+{
+ file_locking_helpers::create_tmp_subdir_and_get_pid_based_filepath
+ (get_lock_file_subdir_name(), get_lock_file_base_name(), get_current_process_id(), s, true);
+}
+
+inline const char *get_shm_base_name()
+{ return "bip.gmem.shm."; }
+
+inline void get_shm_name(std::string &shm_name)
+{
+ file_locking_helpers::get_pid_creation_time_str(shm_name);
+ shm_name.insert(0, get_shm_base_name());
+}
+
+inline std::size_t get_shm_size()
+{ return 65536; }
+
+inline void apply_gmem_erase_logic(const char *filepath, const char *filename);
+
+inline bool remove_old_gmem()
+{
+ std::string refcstrRootDirectory;
+ tmp_folder(refcstrRootDirectory);
+ refcstrRootDirectory += "/";
+ refcstrRootDirectory += get_lock_file_subdir_name();
+ return for_each_file_in_dir(refcstrRootDirectory.c_str(), apply_gmem_erase_logic);
+}
+
+#if (defined BOOST_INTERPROCESS_WINDOWS)
+/*
+inline bool remove_old_gmem()
+{
+ void * hFile; // Handle to directory
+ winapi::win32_find_data_t FileInformation; // File information
+
+ //Get base directory
+ std::string str;
+ tmp_folder(str);
+ str += "/";
+ str += get_lock_file_subdir_name();
+ const std::size_t base_root_dir_len = str.size();
+
+ //Find all files and directories
+ str += "\\*.*";
+ hFile = winapi::find_first_file(str.c_str(), &FileInformation);
+ if(hFile != winapi::invalid_handle_value){
+ do{ //Now loop every file
+ str.erase(base_root_dir_len);
+ //If it's not "." or ".." skip it
+ if(FileInformation.cFileName[0] != '.'){
+ str += "\\"; str += FileInformation.cFileName;
+ //If it's a file, apply erase logic
+ if(!(FileInformation.dwFileAttributes & winapi::file_attribute_directory)){
+ apply_gmem_erase_logic(str.c_str(), FileInformation.cFileName);
+ }
+ }
+ //Go to the next file
+ } while(winapi::find_next_file(hFile, &FileInformation) == 1);
+
+ // Close handle and see if the loop has ended with an error
+ winapi::find_close(hFile);
+ if(winapi::get_last_error() != winapi::error_no_more_files){
+ return false;
+ }
+ }
+ return true;
+}
+*/
+
+struct locking_file_serial_id
+{
+ int fd;
+ unsigned long dwVolumeSerialNumber;
+ unsigned long nFileIndexHigh;
+ unsigned long nFileIndexLow;
+ //This reference count counts the number of modules attached
+ //to the shared memory and lock file. This serves to unlink
+ //the locking file and shared memory when all modules are
+ //done with the global memory (shared memory)
+ volatile boost::uint32_t modules_attached_to_gmem_count;
+};
+
+inline bool lock_locking_file(int fd)
+{
+ int ret = 0;
+ while(ret != 0 && errno == EDEADLK){
+ ret = _locking(fd, _LK_LOCK, 1/*lock_file_contents_length()*/);
+ }
+ return 0 == ret;
+}
+
+inline bool try_lock_locking_file(int fd)
+{
+ return 0 == _locking(fd, _LK_NBLCK , 1);
+}
+
+inline int open_or_create_and_lock_file(const char *name)
+{
+ permissions p;
+ p.set_unrestricted();
+ while(1){
+ file_handle_t handle = create_or_open_file(name, read_write, p);
+ int fd = _open_osfhandle((intptr_t)handle, _O_TEXT);
+ if(fd < 0){
+ close_file(handle);
+ return fd;
+ }
+ if(!try_lock_locking_file(fd)){
+ _close(fd);
+ return -1;
+ }
+ struct _stat s;
+ if(0 == _stat(name, &s)){
+ return fd;
+ }
+ else{
+ _close(fd);
+ }
+ }
+}
+
+inline int try_open_and_lock_file(const char *name)
+{
+ file_handle_t handle = open_existing_file(name, read_write);
+ int fd = _open_osfhandle((intptr_t)handle, _O_TEXT);
+ if(fd < 0){
+ close_file(handle);
+ return fd;
+ }
+ if(!try_lock_locking_file(fd)){
+ _close(fd);
+ return -1;
+ }
+ return fd;
+}
+
+inline void close_lock_file(int fd)
+{ _close(fd); }
+
+inline bool is_valid_fd(int fd)
+{
+ struct _stat s;
+ return EBADF != _fstat(fd, &s);
+}
+
+inline bool is_normal_file(int fd)
+{
+ if(_isatty(fd))
+ return false;
+ struct _stat s;
+ if(0 != _fstat(fd, &s))
+ return false;
+ return 0 != (s.st_mode & _S_IFREG);
+}
+
+inline std::size_t get_size(int fd)
+{
+ struct _stat s;
+ if(0 != _fstat(fd, &s))
+ return 0u;
+ return (std::size_t)s.st_size;
+}
+
+inline bool fill_file_serial_id(int fd, locking_file_serial_id &id)
+{
+ winapi::interprocess_by_handle_file_information info;
+ if(!winapi::get_file_information_by_handle((void*)_get_osfhandle(fd), &info))
+ return false;
+ id.fd = fd;
+ id.dwVolumeSerialNumber = info.dwVolumeSerialNumber;
+ id.nFileIndexHigh = info.nFileIndexHigh;
+ id.nFileIndexLow = info.nFileIndexLow;
+ id.modules_attached_to_gmem_count = 1; //Initialize attached count
+ return true;
+}
+
+inline bool compare_file_serial(int fd, const locking_file_serial_id &id)
+{
+ winapi::interprocess_by_handle_file_information info;
+ if(!winapi::get_file_information_by_handle((void*)_get_osfhandle(fd), &info))
+ return false;
+
+ return id.dwVolumeSerialNumber == info.dwVolumeSerialNumber &&
+ id.nFileIndexHigh == info.nFileIndexHigh &&
+ id.nFileIndexLow == info.nFileIndexLow;
+}
+
+#else //UNIX
+/*
+inline bool remove_old_gmem()
+{
+ std::string refcstrRootDirectory;
+ tmp_folder(refcstrRootDirectory);
+ refcstrRootDirectory += "/";
+ refcstrRootDirectory += get_lock_file_subdir_name();
+
+ DIR *d = opendir(refcstrRootDirectory.c_str());
+ if(!d) {
+ return false;
    }
 
- managed_shared_memory &seg_;
+ struct dir_close
+ {
+ DIR *d_;
+ dir_close(DIR *d) : d_(d) {}
+ ~dir_close() { ::closedir(d_); }
+ } dc(d); (void)dc;
+
+ struct ::dirent *de;
+ struct ::stat st;
+ std::string fn;
+
+ while((de=::readdir(d))) {
+ if( de->d_name[0] == '.' && ( de->d_name[1] == '\0'
+ || (de->d_name[1] == '.' && de->d_name[2] == '\0' )) ){
+ continue;
+ }
+ fn = refcstrRootDirectory;
+ fn += '/';
+ fn += de->d_name;
+
+ //if(std::remove(fn.c_str())) {
+ if(::stat(fn.c_str(), & st)) {
+ return false;
+ }
+ //If it's a file, apply erase logic
+ if(!S_ISDIR(st.st_mode)) {
+ apply_gmem_erase_logic(fn.c_str(), de->d_name);
+ }
+ //}
+ }
+ return true;
+}
+*/
+struct locking_file_serial_id
+{
+ int fd;
+ dev_t st_dev;
+ ino_t st_ino;
+ //This reference count counts the number of modules attached
+ //to the shared memory and lock file. This serves to unlink
+ //the locking file and shared memory when all modules are
+ //done with the global memory (shared memory)
+ volatile boost::uint32_t modules_attached_to_gmem_count;
 };
 
-template<class C>
-struct intermodule_singleton_instantiator
+inline bool lock_locking_file(int fd)
+{
+ int ret = 0;
+ while(ret != 0 && errno != EINTR){
+ struct flock lock;
+ lock.l_type = F_WRLCK;
+ lock.l_whence = SEEK_SET;
+ lock.l_start = 0;
+ lock.l_len = 1;
+ ret = fcntl (fd, F_SETLKW, &lock);
+ }
+ return 0 == ret;
+}
+
+inline bool try_lock_locking_file(int fd)
+{
+ struct flock lock;
+ lock.l_type = F_WRLCK;
+ lock.l_whence = SEEK_SET;
+ lock.l_start = 0;
+ lock.l_len = 1;
+ return 0 == fcntl (fd, F_SETLK, &lock);
+}
+
+inline int open_or_create_and_lock_file(const char *name)
+{
+ permissions p;
+ p.set_unrestricted();
+ while(1){
+ int fd = create_or_open_file(name, read_write, p);
+ if(fd < 0){
+ return fd;
+ }
+ if(!try_lock_locking_file(fd)){
+ close(fd);
+ return -1;
+ }
+ struct stat s;
+ if(0 == stat(name, &s)){
+ return fd;
+ }
+ else{
+ close(fd);
+ }
+ }
+}
+
+inline int try_open_and_lock_file(const char *name)
+{
+ int fd = open_existing_file(name, read_write);
+ if(fd < 0){
+ return fd;
+ }
+ if(!try_lock_locking_file(fd)){
+ close(fd);
+ return -1;
+ }
+ return fd;
+}
+
+inline void close_lock_file(int fd)
+{ close(fd); }
+
+inline bool is_valid_fd(int fd)
+{
+ struct stat s;
+ return EBADF != fstat(fd, &s);
+}
+
+inline bool is_normal_file(int fd)
+{
+ struct stat s;
+ if(0 != fstat(fd, &s))
+ return false;
+ return 0 != (s.st_mode & S_IFREG);
+}
+
+inline std::size_t get_size(int fd)
+{
+ struct stat s;
+ if(0 != fstat(fd, &s))
+ return 0u;
+ return (std::size_t)s.st_size;
+}
+
+inline bool fill_file_serial_id(int fd, locking_file_serial_id &id)
 {
- intermodule_singleton_instantiator()
- : ppref(0), pc(0)
+ struct stat s;
+ if(0 != fstat(fd, &s))
+ return false;
+ id.fd = fd;
+ id.st_dev = s.st_dev;
+ id.st_ino = s.st_ino;
+ id.modules_attached_to_gmem_count = 1; //Initialize attached count
+ return true;
+}
+
+inline bool compare_file_serial(int fd, const locking_file_serial_id &id)
+{
+ struct stat info;
+ if(0 != fstat(fd, &info))
+ return false;
+
+ return id.st_dev == info.st_dev &&
+ id.st_ino == info.st_ino;
+}
+
+#endif
+
+struct gmem_erase_func
+{
+ gmem_erase_func(const char *shm_name, const char *singleton_lock_file_path, managed_shared_memory & shm)
+ :shm_name_(shm_name), singleton_lock_file_path_(singleton_lock_file_path), shm_(shm)
+ {}
+
+ void operator()()
    {
+ locking_file_serial_id *pserial_id = shm_.find<locking_file_serial_id>("lock_file_fd").first;
+ if(pserial_id){
+ pserial_id->fd = GMemMarkToBeRemoved;
+ }
+ delete_file(singleton_lock_file_path_);
+ shared_memory_object::remove(shm_name_);
+ }
    
- bool done = false;
+ const char * const shm_name_;
+ const char * const singleton_lock_file_path_;
+ managed_shared_memory & shm_;
+};
+
+//This function applies shared memory erasure logic based on the passed lock file.
+inline void apply_gmem_erase_logic(const char *filepath, const char *filename)
+{
+ int fd = GMemMarkToBeRemoved;
+ try{
+ std::string str;
+ //If the filename is current process lock file, then avoid it
+ if(file_locking_helpers::check_if_filename_complies_with_pid
+ (filename, get_lock_file_base_name(), get_current_process_id(), str, true)){
+ return;
+ }
+ //Open and lock the other process' lock file
+ fd = try_open_and_lock_file(filepath);
+ if(fd < 0){
+ return;
+ }
+ //If done, then the process is dead so take global shared memory name
+ //(the name is based on the lock file name) and try to apply erasure logic
+ str.insert(0, get_shm_base_name());
       try{
- managed_shared_memory seg(interprocess::create_only, get_singleton_unique_name(), 16384);
- //Register cleanup??? We can't because the address of a local function might be the
- //address of a dll, and that dll can be UNLOADED!!!
- }
- catch(interprocess_exception &ex){
- if(ex.get_error_code() != already_exists_error){
- managed_shared_memory seg(open_only, "unique_name", 16384);
- seg.find_or_construct<referenced_instance*>(unique_instance)();
- }
- else{
- throw;
+ managed_shared_memory shm(open_only, str.c_str());
+ gmem_erase_func func(str.c_str(), filepath, shm);
+ shm.try_atomic_func(func);
+ }
+ catch(interprocess_exception &e){
+ //If shared memory is not found erase the lock file
+ if(e.get_error_code() == not_found_error){
+ delete_file(filepath);
          }
       }
+ }
+ catch(...){
+
+ }
+ if(fd >= 0){
+ close_lock_file(fd);
+ }
+}
+
+} //namespace intermodule_singleton_helpers {
 
+
+
+namespace intermodule_singleton_helpers {
+
+//The lock file logic creates uses a unique instance to a file
+struct lock_file_logic
+{
+ lock_file_logic(managed_shared_memory &shm)
+ : mshm(shm)
+ {}
+
+ locking_file_serial_id * register_lock_file(int fd)
    {
- ppref=seg.find_or_construct<referenced_instance*>(unique_instance)();
- if(*ppref){
- /* As in some OSes Boost.Interprocess memory segments can outlive
- * their associated processes, there is a possibility that we
- * retrieve a dangling pointer (coming from a previous aborted run,
- * for instance). Try to protect against this by checking that
- * the contents of the pointed object are consistent.
- */
- if(std::strcmp(segment_name,(*ppref)->segment_name)!=0){
- *ppref=0; /* dangling pointer! */
- }
- else ++((*ppref)->ref);
- }
- }
- if(!*ppref){
- std::auto_ptr<referenced_instance> apc(
- new referenced_instance(segment_name));
- interprocess::scoped_lock<interprocess::named_mutex> lock(mutex);
- ppref=seg.find_or_construct<referenced_instance*>(
- typeid(C).name())((referenced_instance*)0);
- if(!*ppref)*ppref=apc.release();
- ++((*ppref)->ref);
+ locking_file_serial_id *pinfo = mshm.construct<locking_file_serial_id>("lock_file_fd")();
+ fill_file_serial_id(fd, *pinfo);
+ return pinfo;
    }
- pc=&(*ppref)->c;
+
+ void operator()(void)
+ {
+ retry_with_new_shm = false;
+
+ //First find the file locking descriptor id
+ locking_file_serial_id *pserial_id =
+ mshm.find<locking_file_serial_id>("lock_file_fd").first;
+
+ int fd;
+ //If not found schedule a creation
+ if(!pserial_id){
+ fd = GMemNotPresent;
+ }
+ //Else get it
+ else{
+ fd = pserial_id->fd;
+ }
+ //If we need to create a new one, do it
+ if(fd == GMemNotPresent){
+ std::string lck_str;
+ //Create a unique current pid based lock file path
+ create_and_get_singleton_lock_file_path(lck_str);
+ //Open or create and lock file
+ int fd = intermodule_singleton_helpers::open_or_create_and_lock_file(lck_str.c_str());
+ //If failed, write a bad file descriptor to notify other modules that
+ //something was wrong and unlink shared memory. Mark the function object
+ //to tell caller to retry with another shared memory
+ if(fd < 0){
+ this->register_lock_file(GMemMarkToBeRemoved);
+ std::string s;
+ get_shm_name(s);
+ shared_memory_object::remove(s.c_str());
+ retry_with_new_shm = true;
+ }
+ //If successful, register the file descriptor
+ else{
+ this->register_lock_file(fd);
+ }
+ }
+ //If the fd was invalid (maybe a previous try failed) notify caller that
+ //should retry creation logic, since this shm might have been already
+ //unlinked since the shm was removed
+ else if (fd == GMemMarkToBeRemoved){
+ retry_with_new_shm = true;
+ }
+ //If the stored fd is not valid (a open fd, a normal file with the
+ //expected size, or does not have the same file id number,
+ //then it's an old shm from an old process with the same pid.
+ //If that's the case, mark it as invalid
+ else if(!is_valid_fd(fd) ||
+ !is_normal_file(fd) ||
+ 0 != get_size(fd) ||
+ !compare_file_serial(fd, *pserial_id)){
+ pserial_id->fd = GMemMarkToBeRemoved;
+ std::string s;
+ get_shm_name(s);
+ shared_memory_object::remove(s.c_str());
+ retry_with_new_shm = true;
+ }
+ else{
+ //If the lock file is ok, increment reference count of
+ //attached modules to shared memory
+ atomic_inc32(&pserial_id->modules_attached_to_gmem_count);
+ }
    }
-
- ~intermodule_singleton_instantiator()
+
+ managed_shared_memory &mshm;
+ bool retry_with_new_shm;
+};
+
+} //namespace intermodule_singleton_helpers {
+
+//This class contains common code for all singleton types, so that we instantiate this
+//code just once per module. This class also holds a reference counted shared memory
+//to be used by all instances
+
+template<int Dummy>
+class intermodule_singleton_common
+{
+ public:
+ typedef void*(singleton_constructor_t)(managed_shared_memory &);
+ typedef void (singleton_destructor_t)(void *, managed_shared_memory &);
+
+ static const ::boost::uint32_t Uninitialized = 0u;
+ static const ::boost::uint32_t Initializing = 1u;
+ static const ::boost::uint32_t Initialized = 2u;
+ static const ::boost::uint32_t Broken = 3u;
+
+ static void finalize_singleton_logic(void *ptr, singleton_destructor_t destructor)
    {
- /* As in construction time, actual deletion is performed outside the
- * lock to avoid leaving the lock dangling in case of crash.
- */
-
- referenced_instance* pref=0;
+ if(ptr)
+ destructor(ptr, get_shm());
+ //If this is the last singleton of this module
+ //apply shm destruction.
+ //Note: singletons are destroyed when the module is unloaded
+ //so no threads should be executing or holding references
+ //to this module
+ if(1 == atomic_dec32(&this_module_singleton_count)){
+ destroy_shm();
+ }
+ }
+
+ static void initialize_singleton_logic
+ (void *&ptr, volatile boost::uint32_t &this_module_singleton_initialized, singleton_constructor_t ini_func);
+
+ private:
+ static managed_shared_memory &get_shm()
    {
- interprocess::scoped_lock<interprocess::named_mutex> lock(mutex);
- if(--((*ppref)->ref)==0){
- pref=*ppref;
- *ppref=0;
+ return *static_cast<managed_shared_memory *>(static_cast<void *>(&shm_mem));
+ }
+
+ static const std::size_t MemSize = ((sizeof(managed_shared_memory)-1)/sizeof(max_align))+1u;
+ static void initialize_shm();
+ static void destroy_shm();
+ //Static data, zero-initalized without any dependencies
+ //this_module_singleton_count is the number of singletons used by this module
+ static volatile boost::uint32_t this_module_singleton_count;
+ //this_module_shm_initialized is the state of this module's shm class object
+ static volatile boost::uint32_t this_module_shm_initialized;
+ static max_align shm_mem[MemSize];
+};
+
+template<int Dummy>
+volatile boost::uint32_t intermodule_singleton_common<Dummy>::this_module_singleton_count;
+
+//template<int Dummy>
+//const std::size_t intermodule_singleton_common<Dummy>::MemSize;
+
+template<int Dummy>
+volatile boost::uint32_t intermodule_singleton_common<Dummy>::this_module_shm_initialized;
+
+template<int Dummy>
+max_align intermodule_singleton_common<Dummy>::shm_mem[intermodule_singleton_common<Dummy>::MemSize];
+
+template<int Dummy>
+void intermodule_singleton_common<Dummy>::initialize_shm()
+{
+ //Obtain unique shm name and size
+ std::string s;
+ intermodule_singleton_helpers::get_shm_name(s);
+ const char *ShmName = s.c_str();
+ const std::size_t ShmSize = intermodule_singleton_helpers::get_shm_size();;
+ while(1){
+ //Try to pass shm state to initializing
+ ::boost::uint32_t tmp = atomic_cas32(&this_module_shm_initialized, Initializing, Uninitialized);
+ if(tmp >= Initialized){
+ break;
+ }
+ //If some other thread is doing the work wait
+ else if(tmp == Initializing){
+ thread_yield();
+ }
+ else{ //(tmp == Uninitialized)
+ //If not initialized try it again?
+ try{
+ //Remove old shared memory from the system
+ intermodule_singleton_helpers::remove_old_gmem();
+ //in-place construction of the shared memory class
+ ::new (&get_shm())managed_shared_memory(open_or_create, ShmName, ShmSize);
+ //Use shared memory internal lock to initialize the lock file
+ //that will mark this gmem as "in use".
+ intermodule_singleton_helpers::lock_file_logic f(get_shm());
+ get_shm().atomic_func(f);
+ //If function failed (maybe a competing process has erased the shared
+ //memory between creation and file locking), retry with a new instance.
+ if(f.retry_with_new_shm){
+ get_shm().~managed_shared_memory();
+ atomic_write32(&this_module_shm_initialized, Uninitialized);
+ }
+ else{
+ //Locking succeeded, so this shared memory module-instance is ready
+ atomic_write32(&this_module_shm_initialized, Initialized);
+ break;
+ }
+ }
+ catch(...){
+ //
+ throw;
+ }
       }
    }
- if(pref)delete pref;
+}
+
+struct unlink_shmlogic
+{
+ unlink_shmlogic(managed_shared_memory &mshm)
+ : mshm_(mshm)
+ {}
+ void operator()()
+ {
+ intermodule_singleton_helpers::locking_file_serial_id *pserial_id =
+ mshm_.find<intermodule_singleton_helpers::locking_file_serial_id>
+ ("lock_file_fd").first;
+ BOOST_ASSERT(0 != pserial_id);
+ if(1 == atomic_dec32(&pserial_id->modules_attached_to_gmem_count)){
+ int fd = pserial_id->fd;
+ if(fd > 0){
+ pserial_id->fd = intermodule_singleton_helpers::GMemMarkToBeRemoved;
+ std::string s;
+ intermodule_singleton_helpers::create_and_get_singleton_lock_file_path(s);
+ delete_file(s.c_str());
+ intermodule_singleton_helpers::close_lock_file(fd);
+ intermodule_singleton_helpers::get_shm_name(s);
+ shared_memory_object::remove(s.c_str());
+ }
+ }
    }
+ managed_shared_memory &mshm_;
 };
 
-template<typename C>
-struct intermodule_singleton
+template<int Dummy>
+void intermodule_singleton_common<Dummy>::destroy_shm()
 {
- static C& get()
- {
- static intermodule_singleton_instantiator<C> instance;
- return instance.get();
- }
+ if(!atomic_read32(&this_module_singleton_count)){
+ //This module is being unloaded, so destroy
+ //the shared memory object of this module
+ //and unlink the shared memory if it's the last
+ unlink_shmlogic f(get_shm());
+ get_shm().atomic_func(f);
+ (get_shm()).~managed_shared_memory();
+ atomic_write32(&this_module_shm_initialized, Uninitialized);
+ //Do some cleanup for other processes old gmem instances
+ intermodule_singleton_helpers::remove_old_gmem();
+ }
+}
+
+//Initialize this_module_singleton_ptr, creates the shared memory if needed and also creates an unique
+//opaque type in shared memory through a singleton_constructor_t function call,
+//initializing the passed pointer to that unique instance.
+//
+//We have two concurrency types here. a)the shared memory/singleton creation must
+//be safe between threads of this process but in different modules/dlls. b)
+//the pointer to the singleton is per-module, so we have to protect this
+//initization between threads of the same module.
+//
+//All static variables declared here are shared between inside a module
+//so atomic operations will synchronize only threads of the same module.
+template<int Dummy>
+void intermodule_singleton_common<Dummy>::initialize_singleton_logic
+ (void *&ptr, volatile boost::uint32_t &this_module_singleton_initialized, singleton_constructor_t constructor)
+{
+ //If current module is not initialized enter to lock free logic
+ if(atomic_read32(&this_module_singleton_initialized) != Initialized){
+ //Now a single thread of the module will succeed in this CAS.
+ //trying to pass from Uninitialized to Initializing
+ ::boost::uint32_t previous_module_singleton_initialized = atomic_cas32
+ (&this_module_singleton_initialized, Initializing, Uninitialized);
+ //If the thread succeeded the CAS (winner) it will compete with other
+ //winner threads from other modules to create the shared memory
+ if(previous_module_singleton_initialized == Uninitialized){
+ try{
+ //Now initialize shm, this function solves concurrency issues
+ //between threads of several modules
+ initialize_shm();
+ //Increment the module reference count that reflects how many
+ //singletons this module holds, so that we can safely destroy
+ //module shared memory object when no singleton is left
+ atomic_inc32(&this_module_singleton_count);
+ //Now try to create the singleton in shared memory.
+ //This function solves concurrency issues
+ //between threads of several modules
+ void *tmp = constructor(get_shm());
+ //Insert a barrier before assigning the pointer to
+ //make sure this assignment comes after the initialization
+ atomic_write32(&this_module_singleton_initialized, Initializing);
+ //Assign the singleton address to the module-local pointer
+ ptr = tmp;
+ //Memory barrier inserted, all previous operations should complete
+ //before this one. Now marked as initialized
+ atomic_inc32(&this_module_singleton_initialized);
+ }
+ catch(...){
+ //Mark singleton failed to initialize
+ atomic_write32(&this_module_singleton_initialized, Broken);
+ throw;
+ }
+ }
+ //If previous state was initializing, this means that another winner thread is
+ //trying to initialize the singleton. Just wait until completes its work.
+ else if(previous_module_singleton_initialized == Initializing){
+ while(1){
+ previous_module_singleton_initialized = atomic_read32(&this_module_singleton_initialized);
+ if(previous_module_singleton_initialized >= Initialized){
+ //Already initialized, or exception thrown by initializer thread
+ break;
+ }
+ else if(previous_module_singleton_initialized == Initializing){
+ detail::thread_yield();
+ }
+ else{
+ //This can't be happening!
+ BOOST_ASSERT(0);
+ }
+ }
+ }
+ else if(previous_module_singleton_initialized == Initialized){
+ //Nothing to do here, the singleton is ready
+ }
+ //If previous state was greater than initialized, then memory is broken
+ //trying to initialize the singleton.
+ else{//(previous_module_singleton_initialized > Initialized)
+ throw interprocess_exception("boost::interprocess::intermodule_singleton initialization failed");
+ }
+ }
+ BOOST_ASSERT(ptr != 0);
+}
+
+//Now this class is a singleton, initializing the singleton in
+//the first get() function call if LazyInit is false. If true
+//then the singleton will be initialized when loading the module.
+template<typename C, bool LazyInit = false>
+class intermodule_singleton
+{
+ public:
+ static C& get() //Let's make inlining easy
+ {
+ if(!this_module_singleton_ptr){
+ if(lifetime.dummy_function()) //This forces lifetime instantiation, for reference counted destruction
+ intermodule_singleton_common<0>::initialize_singleton_logic
+ (this_module_singleton_ptr, this_module_singleton_initialized, singleton_constructor);
+ }
+ return *static_cast<C*>(this_module_singleton_ptr);
+ }
+
+ struct ref_count_ptr
+ {
+ ref_count_ptr(C *p, boost::uint32_t count)
+ : ptr(p), singleton_ref_count(count)
+ {}
+ C *ptr;
+ //This reference count serves to count the number of attached
+ //modules to this singleton
+ volatile boost::uint32_t singleton_ref_count;
+ };
+
+ private:
+ //These statics will be zero-initialized without any constructor call dependency
+ //this_module_singleton_ptr will be a module-local pointer to the singleton
+ static void* this_module_singleton_ptr;
+ //this_module_singleton_count will be used to synchronize threads of the same module
+ //for access to a singleton instance, and to flag the state of the
+ //singleton.
+ static volatile boost::uint32_t this_module_singleton_initialized;
+
+ //This class destructor will trigger singleton destruction
+ struct lifetime_type_lazy
+ {
+ bool dummy_function()
+ { return m_dummy == 0; }
 
-private:
+ ~lifetime_type_lazy()
+ {
+ intermodule_singleton_common<0>::finalize_singleton_logic
+ (this_module_singleton_ptr, singleton_destructor);
+ }
+ //Dummy volatile so that the compiler can't resolve its value at compile-time
+ //and can't avoid lifetime_type instantiation if dummy_function() is called.
+ static volatile int m_dummy;
+ };
 
- C& get()const{return *pc;}
-
- private:
- interprocess::managed_shared_memory seg;
- struct referenced_instance
- {
- referenced_instance(const char* segment_name_):ref(0)
+ struct lifetime_type_static
+ : public lifetime_type_lazy
+ {
+ lifetime_type_static()
       {
- std::strcpy(segment_name,segment_name_);
+ intermodule_singleton_common<0>::initialize_singleton_logic
+ (this_module_singleton_ptr, this_module_singleton_initialized, singleton_constructor);
       }
+ };
 
- ~referenced_instance(){segment_name[0]='\0';}
+ typedef typename if_c
+ <LazyInit, lifetime_type_lazy, lifetime_type_static>::type lifetime_type;
 
- char segment_name[128]; /* used to detect dangling pointers */
- mutable long ref;
- C c;
- }** ppref;
- C* pc;
- };
-};
+ static lifetime_type lifetime;
 
-template<typename C>
-inline void atomic_functor<C>::operator()()
-{
- referenced_instance *pptr = seg.find_or_construct<referenced_instance>(unique_instance)();
+ //A functor to be executed inside shared memory lock that just
+ //searches for the singleton in shm and if not present creates a new one.
+ //If singleton constructor throws, the exception is propagated
+ struct init_atomic_func
+ {
+ init_atomic_func(managed_shared_memory &m)
+ : mshm(m)
+ {}
+
+ void operator()()
+ {
+ ref_count_ptr *rcount = mshm.find<ref_count_ptr>(unique_instance).first;
+ if(!rcount){
+ C *p = new C();
+ try{
+ rcount = mshm.construct<ref_count_ptr>(unique_instance)(p, 0u);
+ }
+ catch(...){
+ delete p;
+ throw;
+ }
+ }
+ atomic_inc32(&rcount->singleton_ref_count);
+ ret_ptr = rcount->ptr;
+ }
+ managed_shared_memory &mshm;
+ void *ret_ptr;
+ };
+
+ //A functor to be executed inside shared memory lock that just
+ //deletes the singleton in shm if the attached count reaches to zero
+ struct fini_atomic_func
+ {
+ fini_atomic_func(managed_shared_memory &m)
+ : mshm(m)
+ {}
+
+ void operator()()
+ {
+ ref_count_ptr *rcount = mshm.find<ref_count_ptr>(unique_instance).first;
+ //The object must exist
+ BOOST_ASSERT(rcount);
+ //Check if last reference
+ if(atomic_dec32(&rcount->singleton_ref_count) == 1){
+ //If last, destroy the object
+ BOOST_ASSERT(rcount->ptr != 0);
+ delete rcount->ptr;
+ //Now destroy shm entry
+ bool destroyed = mshm.destroy<ref_count_ptr>(unique_instance);
+ (void)destroyed; BOOST_ASSERT(destroyed == true);
+ }
+ }
+ managed_shared_memory &mshm;
+ void *ret_ptr;
+ };
+
+ //A wrapper to execute init_atomic_func
+ static void *singleton_constructor(managed_shared_memory &mshm)
+ {
+ init_atomic_func f(mshm);
+ mshm.atomic_func(f);
+ return f.ret_ptr;
+ }
+
+ //A wrapper to execute fini_atomic_func
+ static void singleton_destructor(void *p, managed_shared_memory &mshm)
+ { (void)p;
+ fini_atomic_func f(mshm);
+ mshm.atomic_func(f);
+ }
 };
 
+template <typename C, bool L>
+volatile int intermodule_singleton<C, L>::lifetime_type_lazy::m_dummy;
+
+//These will be zero-initialized by the loader
+template <typename C, bool L>
+void *intermodule_singleton<C, L>::this_module_singleton_ptr;
+
+template <typename C, bool L>
+volatile boost::uint32_t intermodule_singleton<C, L>::this_module_singleton_initialized;
+
+template <typename C, bool L>
+typename intermodule_singleton<C, L>::lifetime_type intermodule_singleton<C, L>::lifetime;
+
 
 } //namespace detail{
 } //namespace interprocess{
@@ -163,3 +1040,143 @@
 #include <boost/interprocess/detail/config_end.hpp>
 
 #endif
+
+
+/*
+
+
+
+
+
+
+ if try_lock_file
+ open_shm_1
+open_or_create_shm_1
+ atomic_1
+ mark_to_be_removed
+ remove_file
+ remove_shm
+ close
+
+atomic_1
+ if not present fd
+ if(!create_and_lock) //delete in course, try again later
+ mark_to_be_removed
+ remove_shm_1
+ try_again
+ register_fd
+ else if to_be_removed
+ try_again
+ else if not_valid_fd
+ mark_to_be_removed
+ remove_shm_1
+ try_again
+ else if(valid_fd)
+ continue;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hint: fcntl is a nightmare because:
+
+- to check if a file is locked you must open an new descriptor
+- if you close any descriptor to that file all locks on that file are gone
+- so each time you want to check something is locked without disburbing
+ anything, you must leak that descriptor.
+
+Hints to have only one open descriptor:
+
+- Mark the lock file with a magic string.
+- Store the file descriptor in shared memory.
+- Open or create the shared memory:
+ - If created, no problem,
+ create a file and lock it in a loop testing that the file exists
+ - If opened, take the the stored fd:
+ - Take a lock on shared memory, if time exceeds too much time, unlink it and start again
+ - IF it's a regular file (IFREG, using fstat to check) AND
+ its size is the expected (fstat) AND
+ contains the magic number.
+ LOCK IT
+ ELSE
+ the fd is invalid so unlink the shared memory and try to create it again
+
+
+REMOVE_OLD_GMEM()
+
+lock semaphore
+
+loop all files in /tmp/boost_interprocess/gmem
+ check pattern(name) #PID#.lock
+ if (!pattern)
+ continue;
+ pid = extract_pid(name)
+ if(pid == self_pid)
+ continue;
+ open(name);
+ if(::fnctl(fd, GET_LCK)
+ BOOST_ASSERT(flock.pid != self_pid)
+ continue;
+ shm_remove(bip_gmem_#PID#)
+ unlink(name);
+
+unlock_semaphore
+
+
+
+STATIC_SINGLETON_CONSTRUCTOR
+
+remove_old_gmem()
+
+ managed_shared_memory shm;
+ bool completed = false;
+ while(!completed){
+ exclusive_lock(semaphore);
+ try{
+ managed_shared_memory tmp(create_only, bip_gmem_#SELFPID#, SIZE);
+ shm = ::boost::move(tmp);
+ if(!::open(/tmp/boost_interprocess/gmem/#PID#.lock) ||
+ !::fnctl(fd, LOCK)
+ throw whatever;
+ leave file locked;
+ }
+ catch(interprocess_exception &e){
+ if(e.error_code() != already_exists_error)){
+ throw;
+ }
+ try{
+ managed_shared_memory tmp(open_only, bip_gmem_#SELFPID#)
+ shm = ::boost::move(tmp);
+ }
+ catch(...){
+ if(e.error_code() != not_found_error)){
+ throw;
+ }
+ }
+ }
+ completed = true;
+ }
+ ref_counted_type *rcount = shm.find_or_create<ref_counted_type>(unique_instance)(int(0));
+ atomic_inc(rcount->cnt);
+
+STATIC_SINGLETON_DESTRUCTOR
+
+remove_old_mem()
+
+exclusive_lock(semaphore)
+ ref_count_type *rcount = shm.find_or_create<ref_count_type>("ref_count")(int(0));
+ if(!atomic_dec(rcount->cnt))
+ shm.destroy<T>(unique_instance);
+
+*/

Modified: branches/release/boost/interprocess/detail/intersegment_ptr.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/intersegment_ptr.hpp (original)
+++ branches/release/boost/interprocess/detail/intersegment_ptr.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -35,7 +35,7 @@
 #include <boost/static_assert.hpp> //BOOST_STATIC_ASSERT
 #include <climits> //CHAR_BIT
 #include <boost/integer/static_log2.hpp>
-#include <cassert> //assert
+#include <boost/assert.hpp> //BOOST_ASSERT
 #include <boost/interprocess/detail/multi_segment_services.hpp>
 
 //!\file
@@ -133,7 +133,7 @@
 
    void relative_set_begin_from_base(void *addr)
    {
- assert(addr < static_cast<void*>(this));
+ BOOST_ASSERT(addr < static_cast<void*>(this));
       std::size_t off = reinterpret_cast<char*>(this) - reinterpret_cast<char*>(addr);
       members.relative.beg = off >> align_bits;
    }
@@ -144,7 +144,7 @@
    {
       std::size_t pow = members.relative.pow;
       std::size_t size = (std::size_t(1u) << pow);
- assert(pow >= frc_size_bits);
+ BOOST_ASSERT(pow >= frc_size_bits);
       size |= members.relative.frc << (pow - frc_size_bits);
       return size;
    }
@@ -157,7 +157,7 @@
       pow = detail::floor_log2(orig_size);
       std::size_t low_size = (std::size_t(1) << pow);
       std::size_t diff = orig_size - low_size;
- assert(pow >= frc_size_bits);
+ BOOST_ASSERT(pow >= frc_size_bits);
       std::size_t rounded = detail::get_rounded_size_po2
                               (diff, (1u << (pow - frc_size_bits)));
       if(rounded == low_size){
@@ -168,7 +168,7 @@
       else{
          frc = rounded >> (pow - frc_size_bits);
       }
- assert(((frc << (pow - frc_size_bits)) & (align-1))==0);
+ BOOST_ASSERT(((frc << (pow - frc_size_bits)) & (align-1))==0);
       return low_size + rounded;
    }
 
@@ -177,7 +177,7 @@
 
    void set_mode(std::size_t mode)
    {
- assert(mode < is_max_mode);
+ BOOST_ASSERT(mode < is_max_mode);
       members.direct.ctrl = mode;
    }
 
@@ -328,7 +328,7 @@
             std::size_t pow, frc;
             std::size_t s = calculate_size(this_info.size, pow, frc);
             (void)s;
- assert(this_info.size == s);
+ BOOST_ASSERT(this_info.size == s);
             this->members.relative.pow = pow;
             this->members.relative.frc = frc;
          }
@@ -397,14 +397,14 @@
 
       void pop_back()
       {
- assert(!m_segments.empty());
+ BOOST_ASSERT(!m_segments.empty());
          m_segments.erase(--m_segments.end());
       }
 
 
       void *address_of(std::size_t segment_id)
       {
- assert(segment_id < (std::size_t)m_segments.size());
+ BOOST_ASSERT(segment_id < (std::size_t)m_segments.size());
          return m_segments[segment_id].addr;
       }
 
@@ -451,7 +451,7 @@
       ~mappings_t()
       {
          //Check that all mappings have been erased
- assert(m_ptr_to_segment_info.empty());
+ BOOST_ASSERT(m_ptr_to_segment_info.empty());
       }
    };
 
@@ -517,7 +517,7 @@
       info.id = group_id->get_size();
 
       it_b_t ret = s_map.m_ptr_to_segment_info.insert(value_type(ptr, info));
- assert(ret.second);
+ BOOST_ASSERT(ret.second);
 
       value_eraser<ptr_to_segment_info_t> v_eraser(s_map.m_ptr_to_segment_info, ret.first);
       group_id->push_back(ptr, size);
@@ -537,7 +537,7 @@
          group_id->pop_back();
          std::size_t erased = s_map.m_ptr_to_segment_info.erase(addr);
          (void)erased;
- assert(erased);
+ BOOST_ASSERT(erased);
          return true;
       }
    }
@@ -550,7 +550,7 @@
          typedef typename segment_groups_t::iterator iterator;
          std::pair<iterator, bool> ret =
             s_groups.insert(segment_group_t(*services));
- assert(ret.second);
+ BOOST_ASSERT(ret.second);
          return &*ret.first;
       }
    }

Modified: branches/release/boost/interprocess/detail/managed_memory_impl.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/managed_memory_impl.hpp (original)
+++ branches/release/boost/interprocess/detail/managed_memory_impl.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -35,7 +35,7 @@
 #include <utility>
 #include <fstream>
 #include <new>
-#include <cassert>
+#include <boost/assert.hpp>
 
 //!\file
 //!Describes a named shared memory allocation user class.
@@ -519,7 +519,16 @@
    //!function call. If the functor throws, this function throws.
    template <class Func>
    void atomic_func(Func &f)
- { mp_header->atomic_func(f); }
+ { mp_header->atomic_func(f); }
+
+ //!Tries to call a functor guaranteeing that no new construction, search or
+ //!destruction will be executed by any process while executing the object
+ //!function call. If the atomic function can't be immediatelly executed
+ //!because the internal mutex is already locked, returns false.
+ //!If the functor throws, this function throws.
+ template <class Func>
+ bool try_atomic_func(Func &f)
+ { return mp_header->try_atomic_func(f); }
 
    //!Destroys a named memory object or array.
    //!
@@ -673,7 +682,7 @@
    template<class T>
    typename allocator<T>::type
       get_allocator()
- { return mp_header->BOOST_NESTED_TEMPLATE get_allocator<T>(); }
+ { return mp_header->template get_allocator<T>(); }
 
    //!This is the default deleter to delete types T
    //!from this managed segment.
@@ -688,7 +697,7 @@
    template<class T>
    typename deleter<T>::type
       get_deleter()
- { return mp_header->BOOST_NESTED_TEMPLATE get_deleter<T>(); }
+ { return mp_header->template get_deleter<T>(); }
 
    /// @cond
    //!Tries to find a previous named allocation address. Returns a memory

Modified: branches/release/boost/interprocess/detail/managed_multi_shared_memory.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/managed_multi_shared_memory.hpp (original)
+++ branches/release/boost/interprocess/detail/managed_multi_shared_memory.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -27,11 +27,13 @@
 #include <boost/interprocess/containers/list.hpp>//list
 #include <boost/interprocess/mapped_region.hpp> //mapped_region
 #include <boost/interprocess/shared_memory_object.hpp>
+#include <boost/interprocess/permissions.hpp>
 #include <boost/interprocess/detail/managed_open_or_create_impl.hpp> //managed_open_or_create_impl
 #include <new>
 #include <boost/interprocess/containers/string.hpp>
 #include <boost/interprocess/streams/vectorstream.hpp>
 #include <memory>
+#include <boost/assert.hpp>
 
 //!\file
 //!Describes a named shared memory object allocation user class.
@@ -40,6 +42,11 @@
 
 namespace interprocess {
 
+//TODO: We must somehow obtain the permissions of the first segment
+//to apply them to subsequent segments
+//-Use GetSecurityInfo?
+//-Change everything to use only a shared memory object expanded via truncate()?
+
 //!A basic shared memory named object creation class. Initializes the
 //!shared memory segment. Inherits all basic functionality from
 //!basic_managed_memory_impl<CharType, MemoryAlgorithm, IndexType>
@@ -113,7 +120,7 @@
          alloc_size = (m_min_segment_size > alloc_size) ?
                        m_min_segment_size : alloc_size;
          if(mp_frontend->priv_new_segment(create_open_func::DoCreate,
- alloc_size, 0)){
+ alloc_size, 0, permissions())){
             shmem_list_t::value_type &m_impl = *mp_frontend->m_shmem_list.rbegin();
             return result_type(m_impl.get_real_address(), m_impl.get_real_size()-1);
          }
@@ -190,7 +197,7 @@
          }
          if(mapped){
             bool ret = void_pointer::erase_last_mapping(group);
- assert(ret);(void)ret;
+ BOOST_ASSERT(ret);(void)ret;
          }
          return false;
       }
@@ -233,24 +240,26 @@
 
    basic_managed_multi_shared_memory(create_only_t,
                                      const char *name,
- std::size_t size)
+ std::size_t size,
+ const permissions &perm = permissions())
       : m_group_services(get_this_pointer())
    {
- priv_open_or_create(create_open_func::DoCreate,name, size);
+ priv_open_or_create(create_open_func::DoCreate,name, size, perm);
    }
 
    basic_managed_multi_shared_memory(open_or_create_t,
                                      const char *name,
- std::size_t size)
+ std::size_t size,
+ const permissions &perm = permissions())
       : m_group_services(get_this_pointer())
    {
- priv_open_or_create(create_open_func::DoOpenOrCreate, name, size);
+ priv_open_or_create(create_open_func::DoOpenOrCreate, name, size, perm);
    }
 
    basic_managed_multi_shared_memory(open_only_t, const char *name)
       : m_group_services(get_this_pointer())
    {
- priv_open_or_create(create_open_func::DoOpen, name, 0);
+ priv_open_or_create(create_open_func::DoOpen, name, 0, permissions());
    }
 
    ~basic_managed_multi_shared_memory()
@@ -259,7 +268,8 @@
    private:
    bool priv_open_or_create(typename create_open_func::type_t type,
                              const char *name,
- std::size_t size)
+ std::size_t size,
+ const permissions &perm)
    {
       if(!m_shmem_list.empty())
          return false;
@@ -273,7 +283,7 @@
          m_group_services.set_min_segment_size(size);
 
          if(group){
- if(this->priv_new_segment(type, size, 0)){
+ if(this->priv_new_segment(type, size, 0, perm)){
                return true;
             }
          }
@@ -289,7 +299,8 @@
 
    bool priv_new_segment(typename create_open_func::type_t type,
                           std::size_t size,
- const void *addr)
+ const void *addr,
+ const permissions &perm)
    {
       BOOST_TRY{
          //Get the number of groups of this multi_segment group
@@ -314,7 +325,7 @@
          switch(type){
             case create_open_func::DoCreate:
             {
- managed_impl shm(create_only, name, size, read_write, addr, func);
+ managed_impl shm(create_only, name, size, read_write, addr, func, perm);
                mshm = boost::interprocess::move(shm);
             }
             break;
@@ -328,7 +339,7 @@
 
             case create_open_func::DoOpenOrCreate:
             {
- managed_impl shm(open_or_create, name, size, read_write, addr, func);
+ managed_impl shm(open_or_create, name, size, read_write, addr, func, perm);
                mshm = boost::interprocess::move(shm);
             }
             break;
@@ -362,7 +373,7 @@
          //(*itbeg)->close_with_func(close_func(this));
          //Delete group. All mappings are erased too.
          ret = void_pointer::delete_group(group);
- assert(ret);
+ BOOST_ASSERT(ret);
          m_shmem_list.clear();
       }
    }

Modified: branches/release/boost/interprocess/detail/managed_open_or_create_impl.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/managed_open_or_create_impl.hpp (original)
+++ branches/release/boost/interprocess/detail/managed_open_or_create_impl.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -22,6 +22,7 @@
 #include <boost/interprocess/creation_tags.hpp>
 #include <boost/interprocess/detail/mpl.hpp>
 #include <boost/interprocess/detail/move.hpp>
+#include <boost/interprocess/permissions.hpp>
 #include <boost/cstdint.hpp>
 
 namespace boost {
@@ -60,8 +61,9 @@
    managed_open_or_create_impl(create_only_t,
                  const char *name,
                  std::size_t size,
- mode_t mode = read_write,
- const void *addr = 0)
+ mode_t mode,
+ const void *addr,
+ const permissions &perm)
    {
       m_name = name;
       priv_open_or_create
@@ -69,13 +71,14 @@
          , size
          , mode
          , addr
+ , perm
          , null_mapped_region_function());
    }
 
    managed_open_or_create_impl(open_only_t,
                  const char *name,
- mode_t mode = read_write,
- const void *addr = 0)
+ mode_t mode,
+ const void *addr)
    {
       m_name = name;
       priv_open_or_create
@@ -83,6 +86,7 @@
          , 0
          , mode
          , addr
+ , permissions()
          , null_mapped_region_function());
    }
 
@@ -90,8 +94,9 @@
    managed_open_or_create_impl(open_or_create_t,
                  const char *name,
                  std::size_t size,
- mode_t mode = read_write,
- const void *addr = 0)
+ mode_t mode,
+ const void *addr,
+ const permissions &perm)
    {
       m_name = name;
       priv_open_or_create
@@ -99,6 +104,7 @@
          , size
          , mode
          , addr
+ , perm
          , null_mapped_region_function());
    }
 
@@ -108,7 +114,8 @@
                  std::size_t size,
                  mode_t mode,
                  const void *addr,
- const ConstructFunc &construct_func)
+ const ConstructFunc &construct_func,
+ const permissions &perm)
    {
       m_name = name;
       priv_open_or_create
@@ -116,6 +123,7 @@
          , size
          , mode
          , addr
+ , perm
          , construct_func);
    }
 
@@ -132,6 +140,7 @@
          , 0
          , mode
          , addr
+ , permissions()
          , construct_func);
    }
 
@@ -141,7 +150,8 @@
                  std::size_t size,
                  mode_t mode,
                  const void *addr,
- const ConstructFunc &construct_func)
+ const ConstructFunc &construct_func,
+ const permissions &perm)
    {
       m_name = name;
       priv_open_or_create
@@ -149,6 +159,7 @@
          , size
          , mode
          , addr
+ , perm
          , construct_func);
    }
 
@@ -206,16 +217,16 @@
 
    //These are templatized to allow explicit instantiations
    template<bool dummy>
- static void create_device(DeviceAbstraction &dev, const char *name, std::size_t size, detail::false_)
+ static void create_device(DeviceAbstraction &dev, const char *name, std::size_t size, const permissions &perm, detail::false_)
    {
- DeviceAbstraction tmp(create_only, name, read_write, size);
+ DeviceAbstraction tmp(create_only, name, read_write, size, perm);
       tmp.swap(dev);
    }
 
    template<bool dummy>
- static void create_device(DeviceAbstraction &dev, const char *name, std::size_t, detail::true_)
+ static void create_device(DeviceAbstraction &dev, const char *name, std::size_t, const permissions &perm, detail::true_)
    {
- DeviceAbstraction tmp(create_only, name, read_write);
+ DeviceAbstraction tmp(create_only, name, read_write, perm);
       tmp.swap(dev);
    }
 
@@ -223,6 +234,7 @@
    void priv_open_or_create
       (detail::create_enum_t type, std::size_t size,
        mode_t mode, const void *addr,
+ const permissions &perm,
        ConstructFunc construct_func)
    {
       typedef detail::bool_<FileBased> file_like_t;
@@ -255,7 +267,7 @@
          cow = true;
       }
       else if(type == detail::DoCreate){
- create_device<FileBased>(dev, m_name.c_str(), size, file_like_t());
+ create_device<FileBased>(dev, m_name.c_str(), size, perm, file_like_t());
          created = true;
       }
       else if(type == detail::DoOpenOrCreate){
@@ -266,7 +278,7 @@
          bool completed = false;
          while(!completed){
             try{
- create_device<FileBased>(dev, m_name.c_str(), size, file_like_t());
+ create_device<FileBased>(dev, m_name.c_str(), size, perm, file_like_t());
                created = true;
                completed = true;
             }

Modified: branches/release/boost/interprocess/detail/move.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/move.hpp (original)
+++ branches/release/boost/interprocess/detail/move.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -1,6 +1,7 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright David Abrahams, Vicente Botet, Ion Gaztanaga 2009.
+// (C) Copyright David Abrahams, Vicente Botet 2009.
+// (C) Copyright Ion Gaztanaga 2009-2010.
 // Distributed under the 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,19 +9,11 @@
 // See http://www.boost.org/libs/move for documentation.
 //
 //////////////////////////////////////////////////////////////////////////////
-//
-// Parts of this file come from Adobe's Move library:
-//
-// Copyright 2005-2007 Adobe Systems Incorporated
-// Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
-// or a copy at http://stlab.adobe.com/licenses.html)
-//
-//////////////////////////////////////////////////////////////////////////////
 
 //! \file
 
-#ifndef BOOST_MOVE_HPP
-#define BOOST_MOVE_HPP
+#ifndef BOOST_MOVE_DETAIL_MOVE_HPP
+#define BOOST_MOVE_DETAIL_MOVE_HPP
 
 #include <boost/config.hpp>
 #include <algorithm> //copy, copy_backward
@@ -32,10 +25,51 @@
 #include <boost/type_traits/has_trivial_destructor.hpp>
 #include <boost/utility/addressof.hpp>
 
+//! Defining or undefining this macro will change Boost.Move behaviour
+//! for copyable and movable classes when assigning from non-const rvalues:
+//! \code
+//! copyable_and_movable produce(){ return copyable_and_movable(); }
+//! \endcode
+//! If the macro is NOT defined:
+//! \code
+//! copyable_and_movable cm;
+//! cm = copyable_and_movable(); //object is COPIED (missed optimization)
+//! \endcode
+//! If the macro IS defined:
+//! \code
+//! copyable_and_movable cm;
+//! cm = copyable_and_movable(); //object is MOVED
+//! \endcode
+//! However, the second option has also some downsides. See documentation for more details.
+#define BOOST_MOVE_OPTIMIZED_EMULATION
+
 /// @cond
 
+//Define to easily port between Boost.Move and internal Boost.Interprocess move emulation
+//
+// This configuration is temporary. Boost.Interprocess emulation uses
+// different macros to avoid any redefinition of a top-levl Boost macro.
+// It will disappear once the library is accepted and
+// Boost.Interprocess is updated to the standard interface.
+//
+#define BOOST_MOVE_IN_BOOST_INTERPROCESS_NAMESPACE
+
+#ifdef BOOST_MOVE_IN_BOOST_INTERPROCESS_NAMESPACE
+
+#define INTERPROCESS_NAMESPACE_BEGIN namespace interprocess {
+#define INTERPROCESS_NAMESPACE_END }// namespace interprocess {
+#define BOOST_MOVE_NAMESPACE boost::interprocess
+
+#else //BOOST_MOVE_IN_BOOST_INTERPROCESS_NAMESPACE
+
+#define INTERPROCESS_NAMESPACE_BEGIN
+#define INTERPROCESS_NAMESPACE_END
+#define BOOST_MOVE_NAMESPACE boost
+
+#endif //BOOST_MOVE_IN_BOOST_INTERPROCESS_NAMESPACE
+
 namespace boost {
-namespace interprocess {
+INTERPROCESS_NAMESPACE_BEGIN
 namespace move_detail {
 
 template <class T>
@@ -56,18 +90,43 @@
    enum { value = sizeof(dispatch(trigger())) == sizeof(true_t) };
 };
 
-} //namespace interprocess {
 } //namespace move_detail {
+INTERPROCESS_NAMESPACE_END
 } //namespace boost {
 
 /// @endcond
 
-#if !defined(BOOST_HAS_RVALUE_REFS) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+#if !defined(BOOST_NO_RVALUE_REFERENCES)
+
+#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5)
+
+#define BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
+
+#else
+
+#if defined(_MSC_VER) && (_MSC_VER == 1600)
+#define BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG
+#endif
+
+#endif
+
+#endif
+
+
+#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
 
-//#define BOOST_MOVE_ASSIGN_FROM_NON_CONST_RVALUE
+#include <boost/type_traits/is_fundamental.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#ifdef __GNUC__
+# define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__))
+#else
+# define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS
+#endif
 
 namespace boost {
-namespace interprocess {
+INTERPROCESS_NAMESPACE_BEGIN
 
 //////////////////////////////////////////////////////////////////////////////
 //
@@ -81,7 +140,7 @@
    ~rv();
    rv(rv const&);
    void operator=(rv const&);
-};
+} BOOST_MOVE_ATTRIBUTE_MAY_ALIAS;
 
 //////////////////////////////////////////////////////////////////////////////
 //
@@ -111,20 +170,22 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 template<class T>
-class is_movable
+struct is_movable
    : public ::boost::mpl::bool_<move_detail::is_convertible<T, rv<T>&>::value>
 {
 };
 
 template<class T>
-class is_movable< rv<T> >
+struct is_movable< rv<T> >
    : public ::boost::mpl::bool_<false>
 {
 };
 
 template <class T>
-struct has_nothrow_move : is_movable<T>
-{};
+struct has_nothrow_move
+ : public ::boost::mpl::bool_<false>
+{
+};
 
 //////////////////////////////////////////////////////////////////////////////
 //
@@ -149,6 +210,42 @@
    return x;
 }
 
+
+#define BOOST_RV_REF(TYPE)\
+ ::BOOST_MOVE_NAMESPACE::rv< TYPE >& \
+//
+
+#define BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
+ ::BOOST_MOVE_NAMESPACE::rv< TYPE<ARG1, ARG2> >& \
+//
+
+#define BOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
+ ::BOOST_MOVE_NAMESPACE::rv< TYPE<ARG1, ARG2, ARG3> >& \
+//
+
+
+#define BOOST_FWD_REF(TYPE)\
+ const TYPE & \
+//
+
+#define BOOST_CATCH_CONST_RLVALUE(TYPE)\
+ const ::BOOST_MOVE_NAMESPACE::rv< TYPE >& \
+//
+
+#ifdef BOOST_MOVE_OPTIMIZED_EMULATION
+
+#define BOOST_COPY_ASSIGN_REF(TYPE)\
+ const ::BOOST_MOVE_NAMESPACE::rv< TYPE >& \
+//
+
+#define BOOST_MOVE_MACRO_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
+ const ::BOOST_MOVE_NAMESPACE::rv< TYPE<ARG1, ARG2> >& \
+//
+
+#define BOOST_MOVE_MACRO_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
+ const ::BOOST_MOVE_NAMESPACE::rv< TYPE<ARG1, ARG2, ARG3> >& \
+//
+
 //////////////////////////////////////////////////////////////////////////////
 //
 // forward()
@@ -156,83 +253,108 @@
 //////////////////////////////////////////////////////////////////////////////
 
 template <class T>
-typename enable_if< ::boost::interprocess::move_detail::is_rv<T>, T &>::type
+typename enable_if< ::BOOST_MOVE_NAMESPACE::move_detail::is_rv<T>, T &>::type
    forward(const typename move_detail::identity<T>::type &x)
 {
    return const_cast<T&>(x);
 }
 
 template <class T>
-typename disable_if< ::boost::interprocess::move_detail::is_rv<T>, const T &>::type
+typename disable_if< ::BOOST_MOVE_NAMESPACE::move_detail::is_rv<T>, const T &>::type
    forward(const typename move_detail::identity<T>::type &x)
 {
    return x;
 }
 
-#define BOOST_INTERPROCESS_RV_REF(TYPE)\
- ::boost::interprocess::rv< TYPE >& \
-//
+#else //BOOST_MOVE_OPTIMIZED_EMULATION
 
-#define BOOST_INTERPROCESS_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
- ::boost::interprocess::rv< TYPE<ARG1, ARG2> >& \
+#define BOOST_COPY_ASSIGN_REF(TYPE)\
+ const TYPE & \
 //
 
-#define BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
- ::boost::interprocess::rv< TYPE<ARG1, ARG2, ARG3> >& \
+#define BOOST_MOVE_MACRO_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
+ const TYPE< ARG1, ARG2 >& \
 //
 
-#ifdef BOOST_MOVE_ASSIGN_FROM_NON_CONST_RVALUE
-
-#define BOOST_INTERPROCESS_COPY_ASSIGN_REF(TYPE)\
- const ::boost::interprocess::rv< TYPE >& \
+#define BOOST_MOVE_MACRO_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
+ const TYPE< ARG1, ARG2, ARG3 > & \
 //
 
-#define BOOST_INTERPROCESS_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
- const ::boost::interprocess::rv< TYPE<ARG1, ARG2> >& \
+//////////////////////////////////////////////////////////////////////////////
 //
-
-#define BOOST_INTERPROCESS_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
- const ::boost::interprocess::rv< TYPE<ARG1, ARG2, ARG3> >& \
+// forward()
 //
+//////////////////////////////////////////////////////////////////////////////
 
-#else //BOOST_MOVE_ASSIGN_FROM_NON_CONST_RVALUE
+//Catches const lvalues for movable types
+template <class T>
+const T&
+ forward( BOOST_CATCH_CONST_RLVALUE(T) x
+ , typename ::boost::enable_if_c< ::BOOST_MOVE_NAMESPACE::is_movable<T>::value >::type* = 0)
+{
+ return static_cast<const T&>(x);
+}
 
-#define BOOST_INTERPROCESS_COPY_ASSIGN_REF(TYPE)\
- const TYPE & \
-//
+//Catches const lvalues for non-movable types
+template <class T>
+const T&
+ forward( const T &x
+ , typename ::boost::enable_if_c< !::BOOST_MOVE_NAMESPACE::is_movable<T>::value &&
+ !::boost::move_detail::is_rv<T>::value
+ >::type* = 0)
+{
+ return static_cast<const T&>(x);
+}
 
-#define BOOST_INTERPROCESS_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
- const TYPE< ARG1, ARG2 >& \
-//
+//Catches forwarded ::boost::rv<T> via BOOST_FWD_REFs
+template <class T>
+T &
+ forward( const T &t
+ , typename ::boost::enable_if_c< ::boost::move_detail::is_rv<T>::value >::type* = 0)
+{
+ return const_cast<T&>(t);
+}
 
-#define BOOST_INTERPROCESS_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
- const TYPE< ARG1, ARG2, ARG3 > & \
-//
+//Catches forwarded ::boost::rv<T>
+template <class T, class U>
+const T &
+ forward( const U &u
+ , typename ::boost::enable_if_c< ::boost::is_same< ::boost::rv<T>, U >::value >::type * = 0)
+{
+ return static_cast<const T&>(u);
+}
 
-#endif
+//Catches non-const lvalues
+template <class T>
+T&
+ forward( typename move_detail::identity<T>::type &x
+ , typename ::boost::enable_if_c< !::boost::move_detail::is_rv<T>::value >::type* = 0)
+{
+ return x;
+}
 
-#define BOOST_INTERPROCESS_FWD_REF(TYPE)\
- const TYPE & \
-//
+//Catches non-const rvalues
+template <class T>
+typename enable_if<is_movable<T>, ::boost::rv<T> & >::type
+ forward(BOOST_RV_REF(T) x)
+{ return x; }
 
-#define BOOST_INTERPROCESS_CATCH_CONST_RLVALUE(TYPE)\
- const ::boost::interprocess::rv< TYPE >& \
-//
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 //
-// BOOST_INTERPROCESS_MOVABLE_BUT_NOT_COPYABLE
+// BOOST_MOVABLE_BUT_NOT_COPYABLE
 //
 //////////////////////////////////////////////////////////////////////////////
-#define BOOST_INTERPROCESS_MOVABLE_BUT_NOT_COPYABLE(TYPE)\
+#define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\
    private:\
    TYPE(TYPE &);\
    TYPE& operator=(TYPE &);\
    public:\
- operator ::boost::interprocess::rv<TYPE>&() \
- { return *reinterpret_cast< ::boost::interprocess::rv<TYPE>* >(this); }\
- operator const ::boost::interprocess::rv<TYPE>&() const \
- { return *reinterpret_cast<const ::boost::interprocess::rv<TYPE>* >(this); }\
+ operator ::BOOST_MOVE_NAMESPACE::rv<TYPE>&() \
+ { return *static_cast< ::BOOST_MOVE_NAMESPACE::rv<TYPE>* >(this); }\
+ operator const ::BOOST_MOVE_NAMESPACE::rv<TYPE>&() const \
+ { return *static_cast<const ::BOOST_MOVE_NAMESPACE::rv<TYPE>* >(this); }\
    private:\
 //
 
@@ -242,48 +364,58 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifdef BOOST_MOVE_ASSIGN_FROM_NON_CONST_RVALUE
+#ifdef BOOST_MOVE_OPTIMIZED_EMULATION
 
 #define BOOST_COPYABLE_AND_MOVABLE(TYPE)\
    public:\
    TYPE& operator=(TYPE &t)\
- { this->operator=(static_cast<const ::boost::interprocess::rv<TYPE> &>(const_cast<const TYPE &>(t))); return *this;}\
+ { this->operator=(static_cast<const ::BOOST_MOVE_NAMESPACE::rv<TYPE> &>(const_cast<const TYPE &>(t))); return *this;}\
    public:\
- operator ::boost::interprocess::rv<TYPE>&() \
- { return *reinterpret_cast< ::boost::interprocess::rv<TYPE>* >(this); }\
- operator const ::boost::interprocess::rv<TYPE>&() const \
- { return *reinterpret_cast<const ::boost::interprocess::rv<TYPE>* >(this); }\
+ operator ::BOOST_MOVE_NAMESPACE::rv<TYPE>&() \
+ { return *static_cast< ::BOOST_MOVE_NAMESPACE::rv<TYPE>* >(this); }\
+ operator const ::BOOST_MOVE_NAMESPACE::rv<TYPE>&() const \
+ { return *static_cast<const ::BOOST_MOVE_NAMESPACE::rv<TYPE>* >(this); }\
    private:\
 //
 
-#else //#ifdef BOOST_MOVE_ASSIGN_FROM_NON_CONST_RVALUE
+#else //#ifdef BOOST_MOVE_OPTIMIZED_EMULATION
 
 #define BOOST_COPYABLE_AND_MOVABLE(TYPE)\
    public:\
- operator ::boost::interprocess::rv<TYPE>&() \
- { return *reinterpret_cast< ::boost::interprocess::rv<TYPE>* >(this); }\
- operator const ::boost::interprocess::rv<TYPE>&() const \
- { return *reinterpret_cast<const ::boost::interprocess::rv<TYPE>* >(this); }\
+ operator ::BOOST_MOVE_NAMESPACE::rv<TYPE>&() \
+ { return *static_cast< ::BOOST_MOVE_NAMESPACE::rv<TYPE>* >(this); }\
+ operator const ::BOOST_MOVE_NAMESPACE::rv<TYPE>&() const \
+ { return *static_cast<const ::BOOST_MOVE_NAMESPACE::rv<TYPE>* >(this); }\
    private:\
 //
 
 #endif
 
 
-} //namespace interprocess {
+INTERPROCESS_NAMESPACE_END
 } //namespace boost
 
-#else //BOOST_HAS_RVALUE_REFS
+#else //BOOST_NO_RVALUE_REFERENCES
 
 #include <boost/type_traits/remove_reference.hpp>
 
 namespace boost {
-namespace interprocess {
+INTERPROCESS_NAMESPACE_BEGIN
 
 /// @cond
 
 namespace move_detail {
 
+template<class T>
+struct is_lvalue_reference
+ : public ::boost::mpl::bool_<false>
+{};
+
+template<class T>
+struct is_lvalue_reference<T&>
+ : public ::boost::mpl::bool_<true>
+{};
+
 typedef char one;
 struct two {one _[2];};
 
@@ -308,19 +440,18 @@
 //! For compilers with rvalue references, this traits class returns true
 //! if BOOST_ENABLE_MOVE_EMULATION is activated.
 //!
-//! For other compilers returns true if T is convertible to <i>::boost::interprocess::rv<T>&</i>
+//! For other compilers returns true if T is convertible to <i>::boost::rv<T>&</i>
 template<class T>
-class is_movable
+struct is_movable
    : public ::boost::mpl::bool_<move_detail::internal_member_value_traits<T>::value>
 {
 };
 
-//! For compilers with rvalue references, this traits class returns true
-//! if T && is convertible to T.
-//!
-//! For other compilers returns true if T has implemented move emulation.
+//! By default this traits returns false. Classes with non-thworing move construction
+//! and assignment should specialize this trait to obtain some performance improvements.
 template <class T>
-struct has_nothrow_move : is_movable<T>
+struct has_nothrow_move
+ : public ::boost::mpl::bool_<false>
 {};
 
 //////////////////////////////////////////////////////////////////////////////
@@ -332,15 +463,30 @@
 
 #if defined(BOOST_MOVE_DOXYGEN_INVOKED)
 //! This function provides a way to convert a reference into a rvalue reference
-//! in compilers with rvalue reference. For other compilers converts T & into
-//! <i>::boost::interprocess::rv<T> &</i> so that move emulation is activated.
+//! in compilers with rvalue references. For other compilers converts T & into
+//! <i>::boost::rv<T> &</i> so that move emulation is activated.
 template <class T> inline
 rvalue_reference move (input_reference);
-#else
-template <class T> inline
-typename remove_reference<T>::type&& move(T&& t)
+
+#else //BOOST_MOVE_DOXYGEN_INVOKED
+
+#if defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
+
+//Old move approach, lvalues could bind to rvalue references
+template <class T> inline
+typename remove_reference<T>::type && move(T&& t)
 { return t; }
-#endif
+
+#else //Old move
+
+template <class T> inline
+typename remove_reference<T>::type && move(T&& t)
+{ return static_cast<typename remove_reference<T>::type &&>(t); }
+
+#endif //Old move
+
+#endif //BOOST_MOVE_DOXYGEN_INVOKED
+
 
 //////////////////////////////////////////////////////////////////////////////
 //
@@ -357,16 +503,38 @@
 //! For compilers with rvalue references this function provides perfect forwarding.
 //!
 //! Otherwise:
-//! * If input_reference binds to const ::boost::interprocess::rv<T> & then it output_reference is
+//! * If input_reference binds to const ::boost::rv<T> & then it output_reference is
 //! ::boost::rev<T> &
 //!
 //! * Else, input_reference is equal to output_reference is equal to input_reference.
 template <class T> inline output_reference forward(input_reference);
+
 #else
+
+#if defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
+
+//Old move approach, lvalues could bind to rvalue references
+
 template <class T> inline
 T&& forward (typename move_detail::identity<T>::type&& t)
 { return t; }
-#endif
+
+#else //Old move
+
+//Implementation #5 from N2951, thanks to Howard Hinnant
+
+template <class T, class U>
+inline T&& forward(U&& t
+ , typename enable_if_c<
+ move_detail::is_lvalue_reference<T>::value ? move_detail::is_lvalue_reference<U>::value : true>::type * = 0/*
+ , typename enable_if_c<
+ move_detail::is_convertible
+ <typename remove_reference<U>::type*, typename remove_reference<T>::type*>::value>::type * = 0*/)
+{ return static_cast<T&&>(t); }
+
+#endif //Old move
+
+#endif //BOOST_MOVE_DOXYGEN_INVOKED
 
 //////////////////////////////////////////////////////////////////////////////
 //
@@ -386,7 +554,7 @@
 //! This macro marks a type as movable but not copyable, disabling copy construction
 //! and assignment. The user will need to write a move constructor/assignment as explained
 //! in the documentation to fully write a movable but not copyable class.
-#define BOOST_INTERPROCESS_MOVABLE_BUT_NOT_COPYABLE(TYPE)\
+#define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\
    public:\
    typedef int boost_move_emulation_t;\
    private:\
@@ -403,11 +571,11 @@
 
 /// @cond
 
-#define BOOST_INTERPROCESS_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
+#define BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
    TYPE<ARG1, ARG2> && \
 //
 
-#define BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
+#define BOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
    TYPE<ARG1, ARG2, ARG3> && \
 //
 
@@ -415,14 +583,14 @@
 
 //!This macro is used to achieve portable syntax in move
 //!constructors and assignments for classes marked as
-//!BOOST_COPYABLE_AND_MOVABLE or BOOST_INTERPROCESS_MOVABLE_BUT_NOT_COPYABLE
-#define BOOST_INTERPROCESS_RV_REF(TYPE)\
+//!BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE
+#define BOOST_RV_REF(TYPE)\
    TYPE && \
 //
 
 //!This macro is used to achieve portable syntax in copy
 //!assignment for classes marked as BOOST_COPYABLE_AND_MOVABLE.
-#define BOOST_INTERPROCESS_COPY_ASSIGN_REF(TYPE)\
+#define BOOST_COPY_ASSIGN_REF(TYPE)\
    const TYPE & \
 //
 
@@ -440,21 +608,25 @@
 
 //! This macro is used to implement portable perfect forwarding
 //! as explained in the documentation.
-#define BOOST_INTERPROCESS_FWD_REF(TYPE)\
+#define BOOST_FWD_REF(TYPE)\
    TYPE && \
 //
 
-#define BOOST_INTERPROCESS_CATCH_CONST_RLVALUE(TYPE)\
+/// @cond
+
+#define BOOST_CATCH_CONST_RLVALUE(TYPE)\
    const TYPE & \
 //
 
-} //namespace interprocess {
+/// @endcond
+
+INTERPROCESS_NAMESPACE_END
 } //namespace boost {
 
-#endif //BOOST_HAS_RVALUE_REFS
+#endif //BOOST_NO_RVALUE_REFERENCES
 
 namespace boost {
-namespace interprocess {
+INTERPROCESS_NAMESPACE_BEGIN
 
 //////////////////////////////////////////////////////////////////////////////
 //
@@ -473,12 +645,12 @@
    public:
    typedef It iterator_type;
    typedef typename std::iterator_traits<iterator_type>::value_type value_type;
- #if defined(BOOST_HAS_RVALUE_REFS) || defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ #if !defined(BOOST_NO_RVALUE_REFERENCES) || defined(BOOST_MOVE_DOXYGEN_INVOKED)
    typedef value_type && reference;
    #else
    typedef typename ::boost::mpl::if_
- < ::boost::interprocess::is_movable<value_type>
- , ::boost::interprocess::rv<value_type>&
+ < ::BOOST_MOVE_NAMESPACE::is_movable<value_type>
+ , ::BOOST_MOVE_NAMESPACE::rv<value_type>&
       , value_type & >::type reference;
    #endif
    typedef It pointer;
@@ -502,10 +674,10 @@
 
    reference operator*() const
    {
- #if defined(BOOST_HAS_RVALUE_REFS)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) || defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
       return *m_it;
       #else
- return ::boost::interprocess::move(*m_it);
+ return ::BOOST_MOVE_NAMESPACE::move(*m_it);
       #endif
    }
 
@@ -538,10 +710,10 @@
 
    reference operator[](difference_type n) const
    {
- #if defined(BOOST_HAS_RVALUE_REFS)
+ #if defined(BOOST_NO_RVALUE_REFERENCES) || defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
       return m_it[n];
       #else
- return ::boost::interprocess::move(m_it[n]);
+ return ::BOOST_MOVE_NAMESPACE::move(m_it[n]);
       #endif
    }
 
@@ -584,7 +756,7 @@
 };
 
 template <class I>
-struct is_move_iterator< ::boost::interprocess::move_iterator<I> >
+struct is_move_iterator< ::BOOST_MOVE_NAMESPACE::move_iterator<I> >
    : public ::boost::mpl::bool_<true>
 {
 };
@@ -624,7 +796,7 @@
    explicit back_move_insert_iterator(C& x) : container_m(&x) { }
 
    back_move_insert_iterator& operator=(typename C::reference x)
- { container_m->push_back(boost::interprocess::move(x)); return *this; }
+ { container_m->push_back(BOOST_MOVE_NAMESPACE::move(x)); return *this; }
 
    back_move_insert_iterator& operator*() { return *this; }
    back_move_insert_iterator& operator++() { return *this; }
@@ -659,7 +831,7 @@
    explicit front_move_insert_iterator(C& x) : container_m(&x) { }
 
    front_move_insert_iterator& operator=(typename C::reference x)
- { container_m->push_front(boost::interprocess::move(x)); return *this; }
+ { container_m->push_front(BOOST_MOVE_NAMESPACE::move(x)); return *this; }
 
    front_move_insert_iterator& operator*() { return *this; }
    front_move_insert_iterator& operator++() { return *this; }
@@ -695,7 +867,7 @@
 
    move_insert_iterator& operator=(typename C::reference x)
    {
- pos_ = container_m->insert(pos_, ::boost::interprocess::move(x));
+ pos_ = container_m->insert(pos_, ::BOOST_MOVE_NAMESPACE::move(x));
       ++pos_;
       return *this;
    }
@@ -722,7 +894,7 @@
 
 //! <b>Effects</b>: Moves elements in the range [first,last) into the range [result,result + (last -
 //! first)) starting from first and proceeding to last. For each non-negative integer n < (last-first),
-//! performs *(result + n) = ::boost::interprocess::move (*(first + n)).
+//! performs *(result + n) = ::boost::move (*(first + n)).
 //!
 //! <b>Effects</b>: result + (last - first).
 //!
@@ -734,7 +906,7 @@
 O move(I f, I l, O result)
 {
    while (f != l) {
- *result = ::boost::interprocess::move(*f);
+ *result = ::BOOST_MOVE_NAMESPACE::move(*f);
       ++f; ++result;
    }
    return result;
@@ -749,7 +921,7 @@
 //! <b>Effects</b>: Moves elements in the range [first,last) into the range
 //! [result - (last-first),result) starting from last - 1 and proceeding to
 //! first. For each positive integer n <= (last - first),
-//! performs *(result - n) = ::boost::interprocess::move(*(last - n)).
+//! performs *(result - n) = ::boost::move(*(last - n)).
 //!
 //! <b>Requires</b>: result shall not be in the range [first,last).
 //!
@@ -762,7 +934,7 @@
 {
    while (f != l) {
       --l; --result;
- *result = ::boost::interprocess::move(*l);
+ *result = ::BOOST_MOVE_NAMESPACE::move(*l);
    }
    return result;
 }
@@ -777,7 +949,7 @@
 //! \code
 //! for (; first != last; ++result, ++first)
 //! new (static_cast<void*>(&*result))
-//! typename iterator_traits<ForwardIterator>::value_type(boost::interprocess::move(*first));
+//! typename iterator_traits<ForwardIterator>::value_type(boost::move(*first));
 //! \endcode
 //!
 //! <b>Returns</b>: result
@@ -792,7 +964,7 @@
 {
    typedef typename std::iterator_traits<I>::value_type input_value_type;
    while (f != l) {
- ::new(static_cast<void*>(&*r)) input_value_type(boost::interprocess::move(*f));
+ ::new(static_cast<void*>(&*r)) input_value_type(BOOST_MOVE_NAMESPACE::move(*f));
       ++f; ++r;
    }
    return r;
@@ -823,7 +995,7 @@
 F uninitialized_move_move_iterator(I f, I l, F r,
                              typename enable_if< is_movable<typename I::value_type> >::type* = 0)
 {
- return ::boost::interprocess::uninitialized_move(f, l, r);
+ return ::BOOST_MOVE_NAMESPACE::uninitialized_move(f, l, r);
 }
 
 template
@@ -843,7 +1015,45 @@
 F uninitialized_copy_or_move(I f, I l, F r,
                              typename enable_if< move_detail::is_move_iterator<I> >::type* = 0)
 {
- return ::boost::interprocess::move_detail::uninitialized_move_move_iterator(f, l, r);
+ return ::BOOST_MOVE_NAMESPACE::move_detail::uninitialized_move_move_iterator(f, l, r);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// copy_or_move
+//
+//////////////////////////////////////////////////////////////////////////////
+
+namespace move_detail {
+
+template
+<typename I, // I models InputIterator
+typename F> // F models ForwardIterator
+F move_move_iterator(I f, I l, F r,
+ typename enable_if< is_movable<typename I::value_type> >::type* = 0)
+{
+ return ::BOOST_MOVE_NAMESPACE::move(f, l, r);
+}
+
+template
+<typename I, // I models InputIterator
+typename F> // F models ForwardIterator
+F move_move_iterator(I f, I l, F r,
+ typename disable_if< is_movable<typename I::value_type> >::type* = 0)
+{
+ return std::copy(f.base(), l.base(), r);
+}
+
+
+} //namespace move_detail {
+
+template
+<typename I, // I models InputIterator
+typename F> // F models ForwardIterator
+F copy_or_move(I f, I l, F r,
+ typename enable_if< move_detail::is_move_iterator<I> >::type* = 0)
+{
+ return ::BOOST_MOVE_NAMESPACE::move_detail::move_move_iterator(f, l, r);
 }
 
 /// @endcond
@@ -872,19 +1082,28 @@
    return std::uninitialized_copy(f, l, r);
 }
 
-//! If this trait yields to true
-//! (<i>has_trivial_destructor_after_move_ctor &lt;T&gt;::value == true</i>)
-//! means that if T is used as argument of a move construction,
-//! there is no need to call T's destructor.
-//! This optimization tipically is used to improve containers' performance.
+//! <b>Effects</b>:
+//! \code
+//! for (; first != last; ++result, ++first)
+//! *result = *first;
+//! \endcode
 //!
-//! By default this trait is true if the type has trivial destructor,
-//! every class should specialize this trait if it wants to improve performance
-//! when inserted in containers.
-template <class T>
-struct has_trivial_destructor_after_move_ctor
- : public ::boost::has_trivial_destructor<T>
-{};
+//! <b>Returns</b>: result
+//!
+//! <b>Note</b>: This function is provided because
+//! <i>std::uninitialized_copy</i> from some STL implementations
+//! is not compatible with <i>move_iterator</i>
+template
+<typename I, // I models InputIterator
+typename F> // F models ForwardIterator
+F copy_or_move(I f, I l, F r
+ /// @cond
+ ,typename disable_if< move_detail::is_move_iterator<I> >::type* = 0
+ /// @endcond
+ )
+{
+ return std::copy(f, l, r);
+}
 
 //! If this trait yields to true
 //! (<i>has_trivial_destructor_after_move &lt;T&gt;::value == true</i>)
@@ -900,26 +1119,39 @@
    : public ::boost::has_trivial_destructor<T>
 {};
 
-//! If this trait yields to true
-//! (<i>has_trivial_destructor_after_move_to_moved &lt;T&gt;::value == true</i>)
-//! means that if t1 of type T is being moved to an already moved value t2,
-//! there is no need to call t1's destructor:
-//! <pre>
-//! T t1, t2, t3(::boost::interprocess::move(t2));
-//! t2 = ::boost::interprocess::move(t1);
-//! //There is no need to call t1's destructor
-//! </pre>
-//! This optimization is used to improve containers' performance.
-//!
-//! By default this trait is true if the type has trivial destructor,
-//! every class should specialize this trait if it wants to improve performance
-//! when inserted in containers.
-template <class T>
-struct has_trivial_destructor_after_move_to_moved
- : public has_trivial_destructor_after_move<T>
-{};
+#ifndef BOOST_MOVE_DOXYGEN_INVOKED
+
+#ifdef BOOST_MOVE_IN_BOOST_INTERPROCESS_NAMESPACE
+
+#define BOOST_INTERPROCESS_ENABLE_MOVE_EMULATION(TYPE) BOOST_ENABLE_MOVE_EMULATION(TYPE)
+#define BOOST_INTERPROCESS_MOVABLE_BUT_NOT_COPYABLE(TYPE) BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)
+#define BOOST_INTERPROCESS_COPYABLE_AND_MOVABLE(TYPE) BOOST_COPYABLE_AND_MOVABLE(TYPE)
+#define BOOST_INTERPROCESS_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2) BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)
+#define BOOST_INTERPROCESS_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3) BOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)
+#define BOOST_INTERPROCESS_RV_REF(TYPE) BOOST_RV_REF(TYPE)
+#define BOOST_INTERPROCESS_COPY_ASSIGN_REF(TYPE) BOOST_COPY_ASSIGN_REF(TYPE)
+#define BOOST_INTERPROCESS_COPY_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2) BOOST_COPY_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)
+#define BOOST_INTERPROCESS_COPY_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3) BOOST_COPY_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)
+#define BOOST_INTERPROCESS_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
+#define BOOST_INTERPROCESS_CATCH_CONST_RLVALUE(TYPE) BOOST_CATCH_CONST_RLVALUE(TYPE)
+
+#endif
+
+#define BOOST_MOVE_MACRO_ENABLE_MOVE_EMULATION(TYPE) BOOST_ENABLE_MOVE_EMULATION(TYPE)
+#define BOOST_MOVE_MACRO_MOVABLE_BUT_NOT_COPYABLE(TYPE) BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)
+#define BOOST_MOVE_MACRO_COPYABLE_AND_MOVABLE(TYPE) BOOST_COPYABLE_AND_MOVABLE(TYPE)
+#define BOOST_MOVE_MACRO_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2) BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)
+#define BOOST_MOVE_MACRO_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3) BOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)
+#define BOOST_MOVE_MACRO_RV_REF(TYPE) BOOST_RV_REF(TYPE)
+#define BOOST_MOVE_MACRO_COPY_ASSIGN_REF(TYPE) BOOST_COPY_ASSIGN_REF(TYPE)
+#define BOOST_MOVE_MACRO_COPY_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2) BOOST_COPY_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)
+#define BOOST_MOVE_MACRO_COPY_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3) BOOST_COPY_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)
+#define BOOST_MOVE_MACRO_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
+#define BOOST_MOVE_MACRO_CATCH_CONST_RLVALUE(TYPE) BOOST_CATCH_CONST_RLVALUE(TYPE)
+
+#endif //BOOST_MOVE_DOXYGEN_INVOKED
 
-} //namespace interprocess {
+INTERPROCESS_NAMESPACE_END
 } //namespace boost {
 
-#endif //#ifndef BOOST_MOVE_HPP
+#endif //#ifndef BOOST_MOVE_HPP

Modified: branches/release/boost/interprocess/detail/named_proxy.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/named_proxy.hpp (original)
+++ branches/release/boost/interprocess/detail/named_proxy.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -92,7 +92,7 @@
    void do_increment(detail::false_, const index_tuple<IdxPack...>&)
    {}
 
- tuple<Args&&...> args_;
+ tuple<Args&...> args_;
 };
 
 //!Describes a proxy class that implements named
@@ -120,7 +120,8 @@
    template<class ...Args>
    T *operator()(Args &&...args) const
    {
- CtorNArg<T, is_iterator, Args...> &&ctor_obj = CtorNArg<T, is_iterator, Args...>(boost::interprocess::forward<Args>(args)...);
+ CtorNArg<T, is_iterator, Args...> &&ctor_obj = CtorNArg<T, is_iterator, Args...>
+ (boost::interprocess::forward<Args>(args)...);
       return mp_mngr->template
          generic_construct<T>(mp_name, m_num, m_find, m_dothrow, ctor_obj);
    }

Modified: branches/release/boost/interprocess/detail/os_file_functions.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/os_file_functions.hpp (original)
+++ branches/release/boost/interprocess/detail/os_file_functions.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -13,6 +13,9 @@
 
 #include <boost/interprocess/detail/config_begin.hpp>
 #include <boost/interprocess/detail/workaround.hpp>
+#include <boost/interprocess/errors.hpp>
+#include <boost/interprocess/permissions.hpp>
+
 #include <string>
 
 #if (defined BOOST_INTERPROCESS_WINDOWS)
@@ -52,6 +55,7 @@
 typedef enum { read_only = winapi::generic_read
              , read_write = winapi::generic_read | winapi::generic_write
              , copy_on_write
+ , read_private
              , invalid_mode = 0xffff
              } mode_t;
 
@@ -82,34 +86,36 @@
 { return hnd.handle; }
 
 inline bool create_directory(const char *path)
-{ return winapi::create_directory(path, 0); }
+{ return winapi::create_directory(path); }
 
 inline const char *get_temporary_path()
 { return std::getenv("TMP"); }
 
 
 inline file_handle_t create_new_file
- (const char *name, mode_t mode = read_write, bool temporary = false)
+ (const char *name, mode_t mode, const permissions & perm, bool temporary = false)
 {
    unsigned long attr = temporary ? winapi::file_attribute_temporary : 0;
    return winapi::create_file
- (name, (unsigned int)mode, winapi::create_new, attr);
+ ( name, (unsigned int)mode, winapi::create_new, attr
+ , (winapi::interprocess_security_attributes*)perm.get_permissions());
 }
 
 inline file_handle_t create_or_open_file
- (const char *name, mode_t mode = read_write, bool temporary = false)
+ (const char *name, mode_t mode, const permissions & perm, bool temporary = false)
 {
    unsigned long attr = temporary ? winapi::file_attribute_temporary : 0;
    return winapi::create_file
- (name, (unsigned int)mode, winapi::open_always, attr);
+ ( name, (unsigned int)mode, winapi::open_always, attr
+ , (winapi::interprocess_security_attributes*)perm.get_permissions());
 }
 
 inline file_handle_t open_existing_file
- (const char *name, mode_t mode = read_write, bool temporary = false)
+ (const char *name, mode_t mode, bool temporary = false)
 {
    unsigned long attr = temporary ? winapi::file_attribute_temporary : 0;
    return winapi::create_file
- (name, (unsigned int)mode, winapi::open_existing, attr);
+ (name, (unsigned int)mode, winapi::open_existing, attr, 0);
 }
 
 inline bool delete_file(const char *name)
@@ -121,7 +127,7 @@
    if(!winapi::get_file_size(hnd, filesize))
       return false;
 
- if(size > filesize){
+ if(size > (unsigned long long)filesize){
       if(!winapi::set_file_pointer_ex(hnd, filesize, 0, winapi::file_begin)){
          return false;
       }
@@ -262,8 +268,7 @@
                //if(::SetFileAttributes(strFilePath.c_str(), winapi::file_attribute_normal) == 0)
                //return winapi::get_last_error();
                // Delete file
- if(winapi::delete_file(strFilePath.c_str()) == 0)
- return false;
+ winapi::delete_file(strFilePath.c_str());
             }
          }
       //Go to the next file
@@ -299,6 +304,44 @@
    return delete_subdirectories_recursive(refcstrRootDirectory, dont_delete_this, 0u);
 }
 
+
+template<class Function>
+inline bool for_each_file_in_dir(const char *dir, Function f)
+{
+ void * hFile; // Handle to directory
+ winapi::win32_find_data_t FileInformation; // File information
+
+ //Get base directory
+ std::string str(dir);
+ const std::size_t base_root_dir_len = str.size();
+
+ //Find all files and directories
+ str += "\\*.*";
+ hFile = winapi::find_first_file(str.c_str(), &FileInformation);
+ if(hFile != winapi::invalid_handle_value){
+ do{ //Now loop every file
+ str.erase(base_root_dir_len);
+ //If it's not "." or ".." skip it
+ if(FileInformation.cFileName[0] != '.'){
+ str += "\\"; str += FileInformation.cFileName;
+ //If it's a file, apply erase logic
+ if(!(FileInformation.dwFileAttributes & winapi::file_attribute_directory)){
+ f(str.c_str(), FileInformation.cFileName);
+ }
+ }
+ //Go to the next file
+ } while(winapi::find_next_file(hFile, &FileInformation) == 1);
+
+ // Close handle and see if the loop has ended with an error
+ winapi::find_close(hFile);
+ if(winapi::get_last_error() != winapi::error_no_more_files){
+ return false;
+ }
+ }
+ return true;
+}
+
+
 #else //#if (defined BOOST_INTERPROCESS_WINDOWS)
 
 typedef int file_handle_t;
@@ -313,6 +356,7 @@
 typedef enum { read_only = O_RDONLY
              , read_write = O_RDWR
              , copy_on_write
+ , read_private
              , invalid_mode = 0xffff
              } mode_t;
 
@@ -335,7 +379,7 @@
 { return hnd.handle; }
 
 inline bool create_directory(const char *path)
-{ return ::mkdir(path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == 0; }
+{ return ::mkdir(path, 0777) == 0 && ::chmod(path, 0777) == 0; }
 
 inline const char *get_temporary_path()
 {
@@ -351,24 +395,32 @@
 }
 
 inline file_handle_t create_new_file
- (const char *name, mode_t mode = read_write, bool temporary = false)
+ (const char *name, mode_t mode, const permissions & perm, bool temporary = false)
 {
    (void)temporary;
- return ::open(name, ((int)mode) | O_EXCL | O_CREAT, S_IRWXG | S_IRWXO | S_IRWXU);
+ int ret = ::open(name, ((int)mode) | O_EXCL | O_CREAT, perm.get_permissions());
+ if(ret >= 0){
+ ::fchmod(ret, perm.get_permissions());
+ }
+ return ret;
 }
 
 inline file_handle_t create_or_open_file
- (const char *name, mode_t mode = read_write, bool temporary = false)
+ (const char *name, mode_t mode, const permissions & perm, bool temporary = false)
 {
    (void)temporary;
- return ::open(name, ((int)mode) | O_CREAT, S_IRWXG | S_IRWXO | S_IRWXU);
+ int ret = ::open(name, ((int)mode) | O_CREAT, perm.get_permissions());
+ if(ret >= 0){
+ ::fchmod(ret, perm.get_permissions());
+ }
+ return ret;
 }
 
 inline file_handle_t open_existing_file
- (const char *name, mode_t mode = read_write, bool temporary = false)
+ (const char *name, mode_t mode, bool temporary = false)
 {
    (void)temporary;
- return ::open(name, (int)mode, S_IRWXG | S_IRWXO | S_IRWXU);
+ return ::open(name, (int)mode, 0666);
 }
 
 inline bool delete_file(const char *name)
@@ -388,7 +440,7 @@
 }
 
 inline bool set_file_pointer(file_handle_t hnd, offset_t off, file_pos_t pos)
-{ return off == ::lseek(hnd, off, (int)pos); }
+{ return ((off_t)(-1)) != ::lseek(hnd, off, (int)pos); }
 
 inline bool get_file_pointer(file_handle_t hnd, offset_t &off)
 {
@@ -543,6 +595,48 @@
    return std::remove(refcstrRootDirectory.c_str()) ? false : true;
 }
 
+template<class Function>
+inline bool for_each_file_in_dir(const char *dir, Function f)
+{
+ std::string refcstrRootDirectory(dir);
+
+ DIR *d = opendir(refcstrRootDirectory.c_str());
+ if(!d) {
+ return false;
+ }
+
+ struct dir_close
+ {
+ DIR *d_;
+ dir_close(DIR *d) : d_(d) {}
+ ~dir_close() { ::closedir(d_); }
+ } dc(d); (void)dc;
+
+ struct ::dirent *de;
+ struct ::stat st;
+ std::string fn;
+
+ while((de=::readdir(d))) {
+ if( de->d_name[0] == '.' && ( de->d_name[1] == '\0'
+ || (de->d_name[1] == '.' && de->d_name[2] == '\0' )) ){
+ continue;
+ }
+ fn = refcstrRootDirectory;
+ fn += '/';
+ fn += de->d_name;
+
+ if(::stat(fn.c_str(), & st)) {
+ return false;
+ }
+ //If it's a file, apply erase logic
+ if(!S_ISDIR(st.st_mode)) {
+ f(fn.c_str(), de->d_name);
+ }
+ }
+ return true;
+}
+
+
 //This function erases all the subdirectories of a directory except the one pointed by "dont_delete_this"
 inline bool delete_subdirectories(const std::string &refcstrRootDirectory, const char *dont_delete_this)
 {
@@ -551,6 +645,19 @@
 
 #endif //#if (defined BOOST_INTERPROCESS_WINDOWS)
 
+inline bool open_or_create_directory(const char *dir_name)
+{
+ //If fails, check that it's because it already exists
+ if(!create_directory(dir_name)){
+ error_info info(system_error_code());
+ if(info.get_error_code() != already_exists_error){
+ return false;
+ }
+ }
+ return true;
+}
+
+
 } //namespace detail{
 } //namespace interprocess {
 } //namespace boost {

Modified: branches/release/boost/interprocess/detail/os_thread_functions.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/os_thread_functions.hpp (original)
+++ branches/release/boost/interprocess/detail/os_thread_functions.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -13,6 +13,8 @@
 
 #include <boost/interprocess/detail/config_begin.hpp>
 #include <boost/interprocess/detail/workaround.hpp>
+#include <boost/interprocess/streams/bufferstream.hpp>
+#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
 
 #if (defined BOOST_INTERPROCESS_WINDOWS)
 # include <boost/interprocess/detail/win32_api.hpp>
@@ -78,6 +80,20 @@
    return get_invalid_thread_id();
 }
 
+inline long double get_current_process_creation_time()
+{
+ winapi::interprocess_filetime CreationTime, ExitTime, KernelTime, UserTime;
+
+ get_process_times
+ ( winapi::get_current_process(), &CreationTime, &ExitTime, &KernelTime, &UserTime);
+
+ typedef long double ldouble_t;
+ const ldouble_t resolution = (100.0l/1000000000.0l);
+ return CreationTime.dwHighDateTime*(ldouble_t(1u<<31u)*2.0l*resolution) +
+ CreationTime.dwLowDateTime*resolution;
+}
+
+
 #else //#if (defined BOOST_INTERPROCESS_WINDOWS)
 
 typedef pthread_t OS_thread_id_t;
@@ -160,8 +176,22 @@
    return OS_systemwide_thread_id_t(get_invalid_process_id(), get_invalid_thread_id());
 }
 
+inline long double get_current_process_creation_time()
+{ return 0.0L; }
+
 #endif //#if (defined BOOST_INTERPROCESS_WINDOWS)
 
+typedef char pid_str_t[sizeof(OS_process_id_t)*3+1];
+
+inline void get_pid_str(pid_str_t &pid_str, OS_process_id_t pid)
+{
+ bufferstream bstream(pid_str, sizeof(pid_str));
+ bstream << pid << std::ends;
+}
+
+inline void get_pid_str(pid_str_t &pid_str)
+{ get_pid_str(pid_str, get_current_process_id()); }
+
 } //namespace detail{
 } //namespace interprocess {
 } //namespace boost {

Modified: branches/release/boost/interprocess/detail/posix_time_types_wrk.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/posix_time_types_wrk.hpp (original)
+++ branches/release/boost/interprocess/detail/posix_time_types_wrk.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -20,9 +20,8 @@
 #endif //#ifndef WIN32_LEAN_AND_MEAN
 #endif //#ifdef _WIN32
 
-//#include <boost/date_time/posix_time/ptime.hpp>
-//#include <boost/date_time/microsec_time_clock.hpp>
 #include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <boost/date_time/posix_time/conversion.hpp>
 
 namespace boost {
 namespace interprocess {

Modified: branches/release/boost/interprocess/detail/preprocessor.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/preprocessor.hpp (original)
+++ branches/release/boost/interprocess/detail/preprocessor.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -15,8 +15,7 @@
 # pragma once
 #endif
 
-#include <boost/interprocess/detail/config_begin.hpp>
-#include <boost/interprocess/detail/workaround.hpp>
+#include "config_begin.hpp"
 
 #ifdef BOOST_INTERPROCESS_PERFECT_FORWARDING
 #error "This file is not needed when perfect forwarding is available"
@@ -36,7 +35,7 @@
 //This cast is ugly but it is necessary until "perfect forwarding"
 //is achieved in C++0x. Meanwhile, if we want to be able to
 //bind rvalues with non-const references, we have to be ugly
-#ifdef BOOST_HAS_RVALUE_REFS
+#ifndef BOOST_NO_RVALUE_REFERENCES
    #define BOOST_INTERPROCESS_PP_PARAM_LIST(z, n, data) \
    BOOST_PP_CAT(P, n) && BOOST_PP_CAT(p, n) \
    //!
@@ -46,7 +45,7 @@
    //!
 #endif
 
-#ifdef BOOST_HAS_RVALUE_REFS
+#ifndef BOOST_NO_RVALUE_REFERENCES
    #define BOOST_INTERPROCESS_PARAM(U, u) \
    U && u \
    //!
@@ -56,10 +55,22 @@
    //!
 #endif
 
-#ifdef BOOST_HAS_RVALUE_REFS
+#ifndef BOOST_NO_RVALUE_REFERENCES
+
+#ifdef BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
+
+#define BOOST_INTERPROCESS_AUX_PARAM_INIT(z, n, data) \
+ BOOST_PP_CAT(m_p, n) (BOOST_INTERPROCESS_MOVE_NAMESPACE::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) )) \
+//!
+
+#else
+
 #define BOOST_INTERPROCESS_AUX_PARAM_INIT(z, n, data) \
   BOOST_PP_CAT(m_p, n) (BOOST_PP_CAT(p, n)) \
 //!
+
+#endif
+
 #else
 #define BOOST_INTERPROCESS_AUX_PARAM_INIT(z, n, data) \
   BOOST_PP_CAT(m_p, n) (const_cast<BOOST_PP_CAT(P, n) &>(BOOST_PP_CAT(p, n))) \
@@ -70,10 +81,23 @@
   BOOST_PP_CAT(++m_p, n) \
 //!
 
-#ifdef BOOST_HAS_RVALUE_REFS
+#ifndef BOOST_NO_RVALUE_REFERENCES
+
+#if defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
+
+#define BOOST_INTERPROCESS_AUX_PARAM_DEFINE(z, n, data) \
+ BOOST_PP_CAT(P, n) & BOOST_PP_CAT(m_p, n); \
+//!
+
+#else
+
 #define BOOST_INTERPROCESS_AUX_PARAM_DEFINE(z, n, data) \
   BOOST_PP_CAT(P, n) && BOOST_PP_CAT(m_p, n); \
 //!
+
+#endif //defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
+
+
 #else
 #define BOOST_INTERPROCESS_AUX_PARAM_DEFINE(z, n, data) \
   BOOST_PP_CAT(P, n) & BOOST_PP_CAT(m_p, n); \
@@ -81,13 +105,25 @@
 #endif
 
 #define BOOST_INTERPROCESS_PP_PARAM_FORWARD(z, n, data) \
-boost::interprocess::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) ) \
+::boost::interprocess::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) ) \
+//!
+
+#if !defined(BOOST_NO_RVALUE_REFERENCES) && defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
+
+#include <boost/interprocess/containers/container/detail/stored_ref.hpp>
+
+#define BOOST_INTERPROCESS_PP_MEMBER_FORWARD(z, n, data) \
+::boost::container::containers_detail::stored_ref< BOOST_PP_CAT(P, n) >::forward( BOOST_PP_CAT(m_p, n) ) \
 //!
 
+#else
+
 #define BOOST_INTERPROCESS_PP_MEMBER_FORWARD(z, n, data) \
-boost::interprocess::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(m_p, n) ) \
+::boost::interprocess::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(m_p, n) ) \
 //!
 
+#endif //!defined(BOOST_NO_RVALUE_REFERENCES) && defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
+
 #define BOOST_INTERPROCESS_PP_MEMBER_IT_FORWARD(z, n, data) \
 BOOST_PP_CAT(*m_p, n) \
 //!

Modified: branches/release/boost/interprocess/detail/segment_manager_helper.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/segment_manager_helper.hpp (original)
+++ branches/release/boost/interprocess/detail/segment_manager_helper.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -29,7 +29,7 @@
 #include <string> //char_traits
 #include <new> //std::nothrow
 #include <utility> //std::pair
-#include <cassert> //assert
+#include <boost/assert.hpp> //BOOST_ASSERT
 #include <functional> //unary_function
 #ifndef BOOST_NO_EXCEPTIONS
 #include <exception>
@@ -178,8 +178,8 @@
                get_rounded_size(sizeof(block_header), algn)));
       (void)sz;
       //Some sanity checks
- assert(hdr->m_value_alignment == algn);
- assert(hdr->m_value_bytes % sz == 0);
+ BOOST_ASSERT(hdr->m_value_alignment == algn);
+ BOOST_ASSERT(hdr->m_value_bytes % sz == 0);
       return hdr;
    }
 

Modified: branches/release/boost/interprocess/detail/tmp_dir_helpers.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/tmp_dir_helpers.hpp (original)
+++ branches/release/boost/interprocess/detail/tmp_dir_helpers.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -37,10 +37,8 @@
 #if defined (BOOST_INTERPROCESS_HAS_WINDOWS_KERNEL_BOOTTIME)
 inline void get_bootstamp(std::string &s, bool add = false)
 {
- char bootstamp[winapi::BootstampLength*2+1];
- std::size_t bootstamp_length = winapi::BootstampLength*2;
- winapi::get_boot_time_str(bootstamp, bootstamp_length);
- bootstamp[winapi::BootstampLength*2] = 0;
+ std::string bootstamp;
+ winapi::get_last_bootup_time(bootstamp);
    if(add){
       s += bootstamp;
    }
@@ -102,26 +100,30 @@
    tmp_name += "/boost_interprocess";
 }
 
-
-inline void tmp_filename(const char *filename, std::string &tmp_name)
+inline void tmp_folder(std::string &tmp_name)
 {
    get_tmp_base_dir(tmp_name);
- //Remove final null.
- tmp_name += "/";
    #ifdef BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
+ tmp_name += "/";
    get_bootstamp(tmp_name, true);
- tmp_name += '/';
    #endif
+}
+
+inline void tmp_filename(const char *filename, std::string &tmp_name)
+{
+ tmp_folder(tmp_name);
+ tmp_name += "/";
    tmp_name += filename;
 }
 
-inline void create_tmp_dir_and_get_filename(const char *filename, std::string &tmp_name)
+inline void create_tmp_and_clean_old(std::string &tmp_name)
 {
    //First get the temp directory
- get_tmp_base_dir(tmp_name);
+ std::string root_tmp_name;
+ get_tmp_base_dir(root_tmp_name);
 
    //If fails, check that it's because already exists
- if(!create_directory(tmp_name.c_str())){
+ if(!create_directory(root_tmp_name.c_str())){
       error_info info(system_error_code());
       if(info.get_error_code() != already_exists_error){
          throw interprocess_exception(info);
@@ -129,13 +131,7 @@
    }
 
    #ifdef BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
- //Create a new subdirectory with the bootstamp
- std::string root_tmp_name = tmp_name;
- tmp_name += '/';
- //Obtain bootstamp string
- std::string bootstamp;
- get_bootstamp(bootstamp);
- tmp_name += bootstamp;
+ tmp_folder(tmp_name);
 
    //If fails, check that it's because already exists
    if(!create_directory(tmp_name.c_str())){
@@ -145,12 +141,18 @@
       }
    }
    //Now erase all old directories created in the previous boot sessions
- delete_subdirectories(root_tmp_name, bootstamp.c_str());
+ std::string subdir = tmp_name;
+ subdir.erase(0, root_tmp_name.size()+1);
+ delete_subdirectories(root_tmp_name, subdir.c_str());
+ #else
+ tmp_name = root_tmp_name;
    #endif
+}
 
- //Add filename
- tmp_name += '/';
- tmp_name += filename;
+inline void create_tmp_and_clean_old_and_get_filename(const char *filename, std::string &tmp_name)
+{
+ create_tmp_and_clean_old(tmp_name);
+ tmp_filename(filename, tmp_name);
 }
 
 inline void add_leading_slash(const char *name, std::string &new_name)

Modified: branches/release/boost/interprocess/detail/transform_iterator.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/transform_iterator.hpp (original)
+++ branches/release/boost/interprocess/detail/transform_iterator.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -50,7 +50,7 @@
       : m_value(px)
    {}
 
- T* operator->() const { return &m_value; }
+ T* operator->() const { return const_cast<T*>(&m_value); }
    // This function is needed for MWCW and BCC, which won't call operator->
    // again automatically per 13.3.1.2 para 8
 // operator T*() const { return &m_value; }
@@ -87,13 +87,25 @@
       return result;
    }
 
+ transform_iterator& operator--()
+ { decrement(); return *this; }
+
+ transform_iterator operator--(int)
+ {
+ transform_iterator result (*this);
+ decrement();
+ return result;
+ }
+
    friend bool operator== (const transform_iterator& i, const transform_iterator& i2)
    { return i.equal(i2); }
 
    friend bool operator!= (const transform_iterator& i, const transform_iterator& i2)
    { return !(i == i2); }
 
-/*
+ friend bool operator< (const transform_iterator& i, const transform_iterator& i2)
+ { return i < i2; }
+
    friend bool operator> (const transform_iterator& i, const transform_iterator& i2)
    { return i2 < i; }
 
@@ -102,7 +114,7 @@
 
    friend bool operator>= (const transform_iterator& i, const transform_iterator& i2)
    { return !(i < i2); }
-*/
+
    friend typename Iterator::difference_type operator- (const transform_iterator& i, const transform_iterator& i2)
    { return i2.distance_to(i); }
 
@@ -129,6 +141,9 @@
    typename UnaryFunction::result_type operator*() const
    { return dereference(); }
 
+ typename UnaryFunction::result_type operator[](typename Iterator::difference_type off) const
+ { return UnaryFunction::operator()(m_it[off]); }
+
    operator_arrow_proxy<typename UnaryFunction::result_type>
       operator->() const
    { return operator_arrow_proxy<typename UnaryFunction::result_type>(dereference()); }

Modified: branches/release/boost/interprocess/detail/win32_api.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/win32_api.hpp (original)
+++ branches/release/boost/interprocess/detail/win32_api.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -16,11 +16,14 @@
 #include <cstddef>
 #include <cstring>
 #include <string>
+#include <vector>
 #include <memory>
 
 #if (defined _MSC_VER) && (_MSC_VER >= 1200)
 # pragma once
 # pragma comment( lib, "advapi32.lib" )
+# pragma comment( lib, "oleaut32.lib" )
+# pragma comment( lib, "Ole32.lib" )
 #endif
 
 #if (defined BOOST_INTERPROCESS_WINDOWS)
@@ -30,6 +33,7 @@
 # error "This file can only be included in Windows OS"
 #endif
 
+
 //The structures used in Interprocess with the
 //same binary interface as windows ones
 namespace boost {
@@ -154,16 +158,394 @@
 static void * const hkey_local_machine = (void*)(unsigned long*)(long)(0x80000002);
 static unsigned long key_query_value = 0x0001;
 
+//COM API
+const long RPC_C_AUTHN_LEVEL_PKT_IG = 4;
+const long RPC_C_IMP_LEVEL_IMPERSONATE_IG = 3;
+const long EOAC_NONE_IG = 0;
+const long CLSCTX_INPROC_SERVER_IG = 0x1;
+const long CLSCTX_LOCAL_SERVER_IG = 0x4;
+const long WBEM_FLAG_RETURN_IMMEDIATELY_IG = 0x10;
+const long WBEM_INFINITE_IG = 0xffffffff;
+
 } //namespace winapi {
 } //namespace interprocess {
 } //namespace boost {
 
-#if !defined( BOOST_USE_WINDOWS_H )
 
 namespace boost {
 namespace interprocess {
 namespace winapi {
 
+struct GUID_IG
+{
+ unsigned long Data1;
+ unsigned short Data2;
+ unsigned short Data3;
+ unsigned char Data4[8];
+};
+
+const GUID_IG CLSID_WbemAdministrativeLocator =
+ { 0xcb8555cc, 0x9128, 0x11d1, {0xad, 0x9b, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff}};
+
+const GUID_IG IID_IUnknown = { 0x00000000, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}};
+
+struct wchar_variant
+{
+ unsigned long long dummy;
+ union value_t{
+ wchar_t *pbstrVal;
+ unsigned long long dummy;
+ } value;
+};
+
+ struct IUnknown_IG
+ {
+ public:
+ virtual long __stdcall QueryInterface(
+ /* [in] */ const GUID_IG &riid,
+ /* [iid_is][out] */ void **ppvObject) = 0;
+
+ virtual unsigned long __stdcall AddRef( void) = 0;
+
+ virtual unsigned long __stdcall Release( void) = 0;
+ };
+
+struct IWbemClassObject_IG : public IUnknown_IG
+{
+ public:
+ virtual long __stdcall GetQualifierSet(
+ /* [out] */ void **ppQualSet) = 0;
+
+ virtual long __stdcall Get(
+ /* [string][in] */ const wchar_t * wszName,
+ /* [in] */ long lFlags,
+ /* [unique][in][out] */ wchar_variant *pVal,
+ /* [unique][in][out] */ long *pType,
+ /* [unique][in][out] */ long *plFlavor) = 0;
+
+ virtual long __stdcall Put(
+ /* [string][in] */ const wchar_t * wszName,
+ /* [in] */ long lFlags,
+ /* [in] */ wchar_variant *pVal,
+ /* [in] */ long Type) = 0;
+
+ virtual long __stdcall Delete(
+ /* [string][in] */ const wchar_t * wszName) = 0;
+
+ virtual long __stdcall GetNames(
+ /* [string][in] */ const wchar_t * wszQualifierName,
+ /* [in] */ long lFlags,
+ /* [in] */ wchar_variant *pQualifierVal,
+ /* [out] */ void * *pNames) = 0;
+
+ virtual long __stdcall BeginEnumeration(
+ /* [in] */ long lEnumFlags) = 0;
+
+ virtual long __stdcall Next(
+ /* [in] */ long lFlags,
+ /* [unique][in][out] */ wchar_t * *strName,
+ /* [unique][in][out] */ wchar_variant *pVal,
+ /* [unique][in][out] */ long *pType,
+ /* [unique][in][out] */ long *plFlavor) = 0;
+
+ virtual long __stdcall EndEnumeration( void) = 0;
+
+ virtual long __stdcall GetPropertyQualifierSet(
+ /* [string][in] */ const wchar_t * wszProperty,
+ /* [out] */ void **ppQualSet) = 0;
+
+ virtual long __stdcall Clone(
+ /* [out] */ IWbemClassObject_IG **ppCopy) = 0;
+
+ virtual long __stdcall GetObjectText(
+ /* [in] */ long lFlags,
+ /* [out] */ wchar_t * *pstrObjectText) = 0;
+
+ virtual long __stdcall SpawnDerivedClass(
+ /* [in] */ long lFlags,
+ /* [out] */ IWbemClassObject_IG **ppNewClass) = 0;
+
+ virtual long __stdcall SpawnInstance(
+ /* [in] */ long lFlags,
+ /* [out] */ IWbemClassObject_IG **ppNewInstance) = 0;
+
+ virtual long __stdcall CompareTo(
+ /* [in] */ long lFlags,
+ /* [in] */ IWbemClassObject_IG *pCompareTo) = 0;
+
+ virtual long __stdcall GetPropertyOrigin(
+ /* [string][in] */ const wchar_t * wszName,
+ /* [out] */ wchar_t * *pstrClassName) = 0;
+
+ virtual long __stdcall InheritsFrom(
+ /* [in] */ const wchar_t * strAncestor) = 0;
+
+ virtual long __stdcall GetMethod(
+ /* [string][in] */ const wchar_t * wszName,
+ /* [in] */ long lFlags,
+ /* [out] */ IWbemClassObject_IG **ppInSignature,
+ /* [out] */ IWbemClassObject_IG **ppOutSignature) = 0;
+
+ virtual long __stdcall PutMethod(
+ /* [string][in] */ const wchar_t * wszName,
+ /* [in] */ long lFlags,
+ /* [in] */ IWbemClassObject_IG *pInSignature,
+ /* [in] */ IWbemClassObject_IG *pOutSignature) = 0;
+
+ virtual long __stdcall DeleteMethod(
+ /* [string][in] */ const wchar_t * wszName) = 0;
+
+ virtual long __stdcall BeginMethodEnumeration(
+ /* [in] */ long lEnumFlags) = 0;
+
+ virtual long __stdcall NextMethod(
+ /* [in] */ long lFlags,
+ /* [unique][in][out] */ wchar_t * *pstrName,
+ /* [unique][in][out] */ IWbemClassObject_IG **ppInSignature,
+ /* [unique][in][out] */ IWbemClassObject_IG **ppOutSignature) = 0;
+
+ virtual long __stdcall EndMethodEnumeration( void) = 0;
+
+ virtual long __stdcall GetMethodQualifierSet(
+ /* [string][in] */ const wchar_t * wszMethod,
+ /* [out] */ void **ppQualSet) = 0;
+
+ virtual long __stdcall GetMethodOrigin(
+ /* [string][in] */ const wchar_t * wszMethodName,
+ /* [out] */ wchar_t * *pstrClassName) = 0;
+
+};
+
+
+struct IWbemContext_IG : public IUnknown_IG
+{
+public:
+ virtual long __stdcall Clone(
+ /* [out] */ IWbemContext_IG **ppNewCopy) = 0;
+
+ virtual long __stdcall GetNames(
+ /* [in] */ long lFlags,
+ /* [out] */ void * *pNames) = 0;
+
+ virtual long __stdcall BeginEnumeration(
+ /* [in] */ long lFlags) = 0;
+
+ virtual long __stdcall Next(
+ /* [in] */ long lFlags,
+ /* [out] */ wchar_t * *pstrName,
+ /* [out] */ wchar_variant *pValue) = 0;
+
+ virtual long __stdcall EndEnumeration( void) = 0;
+
+ virtual long __stdcall SetValue(
+ /* [string][in] */ const wchar_t * wszName,
+ /* [in] */ long lFlags,
+ /* [in] */ wchar_variant *pValue) = 0;
+
+ virtual long __stdcall GetValue(
+ /* [string][in] */ const wchar_t * wszName,
+ /* [in] */ long lFlags,
+ /* [out] */ wchar_variant *pValue) = 0;
+
+ virtual long __stdcall DeleteValue(
+ /* [string][in] */ const wchar_t * wszName,
+ /* [in] */ long lFlags) = 0;
+
+ virtual long __stdcall DeleteAll( void) = 0;
+
+};
+
+
+struct IEnumWbemClassObject_IG : public IUnknown_IG
+{
+public:
+ virtual long __stdcall Reset( void) = 0;
+
+ virtual long __stdcall Next(
+ /* [in] */ long lTimeout,
+ /* [in] */ unsigned long uCount,
+ /* [length_is][size_is][out] */ IWbemClassObject_IG **apObjects,
+ /* [out] */ unsigned long *puReturned) = 0;
+
+ virtual long __stdcall NextAsync(
+ /* [in] */ unsigned long uCount,
+ /* [in] */ void *pSink) = 0;
+
+ virtual long __stdcall Clone(
+ /* [out] */ void **ppEnum) = 0;
+
+ virtual long __stdcall Skip(
+ /* [in] */ long lTimeout,
+ /* [in] */ unsigned long nCount) = 0;
+
+};
+
+struct IWbemServices_IG : public IUnknown_IG
+{
+public:
+ virtual long __stdcall OpenNamespace(
+ /* [in] */ const wchar_t * strNamespace,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [unique][in][out] */ void **ppWorkingNamespace,
+ /* [unique][in][out] */ void **ppResult) = 0;
+
+ virtual long __stdcall CancelAsyncCall(
+ /* [in] */ void *pSink) = 0;
+
+ virtual long __stdcall QueryObjectSink(
+ /* [in] */ long lFlags,
+ /* [out] */ void **ppResponseHandler) = 0;
+
+ virtual long __stdcall GetObject(
+ /* [in] */ const wchar_t * strObjectPath,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [unique][in][out] */ void **ppObject,
+ /* [unique][in][out] */ void **ppCallResult) = 0;
+
+ virtual long __stdcall GetObjectAsync(
+ /* [in] */ const wchar_t * strObjectPath,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [in] */ void *pResponseHandler) = 0;
+
+ virtual long __stdcall PutClass(
+ /* [in] */ IWbemClassObject_IG *pObject,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [unique][in][out] */ void **ppCallResult) = 0;
+
+ virtual long __stdcall PutClassAsync(
+ /* [in] */ IWbemClassObject_IG *pObject,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [in] */ void *pResponseHandler) = 0;
+
+ virtual long __stdcall DeleteClass(
+ /* [in] */ const wchar_t * strClass,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [unique][in][out] */ void **ppCallResult) = 0;
+
+ virtual long __stdcall DeleteClassAsync(
+ /* [in] */ const wchar_t * strClass,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [in] */ void *pResponseHandler) = 0;
+
+ virtual long __stdcall CreateClassEnum(
+ /* [in] */ const wchar_t * strSuperclass,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [out] */ void **ppEnum) = 0;
+
+ virtual long __stdcall CreateClassEnumAsync(
+ /* [in] */ const wchar_t * strSuperclass,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [in] */ void *pResponseHandler) = 0;
+
+ virtual long __stdcall PutInstance(
+ /* [in] */ void *pInst,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [unique][in][out] */ void **ppCallResult) = 0;
+
+ virtual long __stdcall PutInstanceAsync(
+ /* [in] */ void *pInst,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [in] */ void *pResponseHandler) = 0;
+
+ virtual long __stdcall DeleteInstance(
+ /* [in] */ const wchar_t * strObjectPath,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [unique][in][out] */ void **ppCallResult) = 0;
+
+ virtual long __stdcall DeleteInstanceAsync(
+ /* [in] */ const wchar_t * strObjectPath,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [in] */ void *pResponseHandler) = 0;
+
+ virtual long __stdcall CreateInstanceEnum(
+ /* [in] */ const wchar_t * strFilter,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [out] */ void **ppEnum) = 0;
+
+ virtual long __stdcall CreateInstanceEnumAsync(
+ /* [in] */ const wchar_t * strFilter,
+ /* [in] */ long lFlags,
+ /* [in] */ void *pCtx,
+ /* [in] */ void *pResponseHandler) = 0;
+
+ virtual long __stdcall ExecQuery(
+ /* [in] */ const wchar_t * strQueryLanguage,
+ /* [in] */ const wchar_t * strQuery,
+ /* [in] */ long lFlags,
+ /* [in] */ IWbemContext_IG *pCtx,
+ /* [out] */ IEnumWbemClassObject_IG **ppEnum) = 0;
+
+ virtual long __stdcall ExecQueryAsync(
+ /* [in] */ const wchar_t * strQueryLanguage,
+ /* [in] */ const wchar_t * strQuery,
+ /* [in] */ long lFlags,
+ /* [in] */ IWbemContext_IG *pCtx,
+ /* [in] */ void *pResponseHandler) = 0;
+
+ virtual long __stdcall ExecNotificationQuery(
+ /* [in] */ const wchar_t * strQueryLanguage,
+ /* [in] */ const wchar_t * strQuery,
+ /* [in] */ long lFlags,
+ /* [in] */ IWbemContext_IG *pCtx,
+ /* [out] */ void **ppEnum) = 0;
+
+ virtual long __stdcall ExecNotificationQueryAsync(
+ /* [in] */ const wchar_t * strQueryLanguage,
+ /* [in] */ const wchar_t * strQuery,
+ /* [in] */ long lFlags,
+ /* [in] */ IWbemContext_IG *pCtx,
+ /* [in] */ void *pResponseHandler) = 0;
+
+ virtual long __stdcall ExecMethod(
+ /* [in] */ const wchar_t * strObjectPath,
+ /* [in] */ const wchar_t * strMethodName,
+ /* [in] */ long lFlags,
+ /* [in] */ IWbemContext_IG *pCtx,
+ /* [in] */ IWbemClassObject_IG *pInParams,
+ /* [unique][in][out] */ IWbemClassObject_IG **ppOutParams,
+ /* [unique][in][out] */ void **ppCallResult) = 0;
+
+ virtual long __stdcall ExecMethodAsync(
+ /* [in] */ const wchar_t * strObjectPath,
+ /* [in] */ const wchar_t * strMethodName,
+ /* [in] */ long lFlags,
+ /* [in] */ IWbemContext_IG *pCtx,
+ /* [in] */ IWbemClassObject_IG *pInParams,
+ /* [in] */ void *pResponseHandler) = 0;
+
+};
+
+struct IWbemLocator_IG : public IUnknown_IG
+{
+public:
+ virtual long __stdcall ConnectServer(
+ /* [in] */ const wchar_t * strNetworkResource,
+ /* [in] */ const wchar_t * strUser,
+ /* [in] */ const wchar_t * strPassword,
+ /* [in] */ const wchar_t * strLocale,
+ /* [in] */ long lSecurityFlags,
+ /* [in] */ const wchar_t * strAuthority,
+ /* [in] */ void *pCtx,
+ /* [out] */ IWbemServices_IG **ppNamespace) = 0;
+
+};
+
+
+
 struct interprocess_overlapped
 {
    unsigned long *internal;
@@ -349,6 +731,20 @@
    unsigned char Reserved1[SystemTimeOfDayInfoLength];
 };
 
+struct interprocess_by_handle_file_information
+{
+ unsigned long dwFileAttributes;
+ interprocess_filetime ftCreationTime;
+ interprocess_filetime ftLastAccessTime;
+ interprocess_filetime ftLastWriteTime;
+ unsigned long dwVolumeSerialNumber;
+ unsigned long nFileSizeHigh;
+ unsigned long nFileSizeLow;
+ unsigned long nNumberOfLinks;
+ unsigned long nFileIndexHigh;
+ unsigned long nFileIndexLow;
+};
+
 enum system_information_class {
    system_basic_information = 0,
    system_performance_information = 2,
@@ -379,6 +775,10 @@
 //Some windows API declarations
 extern "C" __declspec(dllimport) unsigned long __stdcall GetCurrentProcessId();
 extern "C" __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId();
+extern "C" __declspec(dllimport) int __stdcall GetProcessTimes
+ ( void *hProcess, interprocess_filetime* lpCreationTime
+ , interprocess_filetime *lpExitTime,interprocess_filetime *lpKernelTime
+ , interprocess_filetime *lpUserTime );
 extern "C" __declspec(dllimport) void __stdcall Sleep(unsigned long);
 extern "C" __declspec(dllimport) unsigned long __stdcall GetLastError();
 extern "C" __declspec(dllimport) void * __stdcall GetCurrentProcess();
@@ -409,6 +809,7 @@
 extern "C" __declspec(dllimport) int __stdcall MoveFileExA (const char *, const char *, unsigned long);
 extern "C" __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *);
 extern "C" __declspec(dllimport) int __stdcall FlushViewOfFile (void *, std::size_t);
+extern "C" __declspec(dllimport) int __stdcall FlushFileBuffers (void *);
 extern "C" __declspec(dllimport) int __stdcall GetFileSizeEx (void *, __int64 *size);
 extern "C" __declspec(dllimport) unsigned long __stdcall FormatMessageA
    (unsigned long dwFlags, const void *lpSource, unsigned long dwMessageId,
@@ -433,6 +834,28 @@
 extern "C" __declspec(dllimport) int __stdcall FreeLibrary(void *);
 extern "C" __declspec(dllimport) void *__stdcall GetProcAddress(void *, const char*);
 extern "C" __declspec(dllimport) void *__stdcall GetModuleHandleA(const char*);
+extern "C" __declspec(dllimport) void *__stdcall GetFileInformationByHandle(void *, interprocess_by_handle_file_information*);
+
+
+//COM API
+extern "C" __declspec(dllimport) long __stdcall CoInitialize(void *pvReserved);
+extern "C" __declspec(dllimport) long __stdcall CoInitializeSecurity(
+ void* pSecDesc,
+ long cAuthSvc,
+ void *asAuthSvc,
+ void *pReserved1,
+ unsigned long dwAuthnLevel,
+ unsigned long dwImpLevel,
+ void *pAuthList,
+ unsigned long dwCapabilities,
+ void *pReserved3 );
+
+extern "C" __declspec(dllimport) long __stdcall VariantClear(wchar_variant * pvarg);
+extern "C" __declspec(dllimport) long __stdcall CoCreateInstance(const GUID_IG & rclsid, IUnknown_IG *pUnkOuter,
+ unsigned long dwClsContext, const GUID_IG & riid, void** ppv);
+extern "C" __declspec(dllimport) void __stdcall CoUninitialize(void);
+
+
 
 //API function typedefs
 //Pointer to functions
@@ -459,10 +882,6 @@
 } //namespace interprocess {
 } //namespace boost {
 
-#else
-# include <windows.h>
-#endif //#if !defined( BOOST_USE_WINDOWS_H )
-
 namespace boost {
 namespace interprocess {
 namespace winapi {
@@ -492,6 +911,12 @@
 inline unsigned long get_current_thread_id()
 { return GetCurrentThreadId(); }
 
+inline bool get_process_times
+ ( void *hProcess, interprocess_filetime* lpCreationTime
+ , interprocess_filetime *lpExitTime, interprocess_filetime *lpKernelTime
+ , interprocess_filetime *lpUserTime )
+{ return 0 != GetProcessTimes(hProcess, lpCreationTime, lpExitTime, lpKernelTime, lpUserTime); }
+
 inline unsigned long get_current_process_id()
 { return GetCurrentProcessId(); }
 
@@ -547,20 +972,33 @@
 inline void *open_semaphore(const char *name)
 { return OpenSemaphoreA(semaphore_all_access, 1, name); }
 
-inline void * create_file_mapping (void * handle, unsigned long access, unsigned long high_size, unsigned long low_size, const char * name)
+class interprocess_all_access_security
 {
    interprocess_security_attributes sa;
    interprocess_security_descriptor sd;
+ bool initialized;
 
- if(!InitializeSecurityDescriptor(&sd, security_descriptor_revision))
- return 0;
- if(!SetSecurityDescriptorDacl(&sd, true, 0, false))
- return 0;
- sa.lpSecurityDescriptor = &sd;
- sa.nLength = sizeof(interprocess_security_attributes);
- sa.bInheritHandle = false;
- return CreateFileMappingA (handle, &sa, access, high_size, low_size, name);
- //return CreateFileMappingA (handle, 0, access, high_size, low_size, name);
+ public:
+ interprocess_all_access_security()
+ : initialized(false)
+ {
+ if(!InitializeSecurityDescriptor(&sd, security_descriptor_revision))
+ return;
+ if(!SetSecurityDescriptorDacl(&sd, true, 0, false))
+ return;
+ sa.lpSecurityDescriptor = &sd;
+ sa.nLength = sizeof(interprocess_security_attributes);
+ sa.bInheritHandle = false;
+ initialized = false;
+ }
+
+ interprocess_security_attributes *get_attributes()
+ { return &sa; }
+};
+
+inline void * create_file_mapping (void * handle, unsigned long access, unsigned long high_size, unsigned long low_size, const char * name, interprocess_security_attributes *psec)
+{
+ return CreateFileMappingA (handle, psec, access, high_size, low_size, name);
 }
 
 inline void * open_file_mapping (unsigned long access, const char *name)
@@ -569,12 +1007,12 @@
 inline void *map_view_of_file_ex(void *handle, unsigned long file_access, unsigned long highoffset, unsigned long lowoffset, std::size_t numbytes, void *base_addr)
 { return MapViewOfFileEx(handle, file_access, highoffset, lowoffset, numbytes, base_addr); }
 
-inline void *create_file(const char *name, unsigned long access, unsigned long creation_flags, unsigned long attributes = 0)
+inline void *create_file(const char *name, unsigned long access, unsigned long creation_flags, unsigned long attributes, interprocess_security_attributes *psec)
 {
    for (unsigned int attempt(0); attempt < error_sharing_violation_tries; ++attempt){
       void * const handle = CreateFileA(name, access,
                                         file_share_read | file_share_write | file_share_delete,
- 0, creation_flags, attributes, 0);
+ psec, creation_flags, attributes, 0);
       bool const invalid(invalid_handle_value == handle);
       if (!invalid){
          return handle;
@@ -596,14 +1034,20 @@
 inline void get_system_info(system_info *info)
 { GetSystemInfo(info); }
 
-inline int flush_view_of_file(void *base_addr, std::size_t numbytes)
-{ return FlushViewOfFile(base_addr, numbytes); }
+inline bool flush_view_of_file(void *base_addr, std::size_t numbytes)
+{ return 0 != FlushViewOfFile(base_addr, numbytes); }
+
+inline bool flush_file_buffers(void *handle)
+{ return 0 != FlushFileBuffers(handle); }
 
 inline bool get_file_size(void *handle, __int64 &size)
 { return 0 != GetFileSizeEx(handle, &size); }
 
-inline bool create_directory(const char *name, interprocess_security_attributes* security)
-{ return 0 != CreateDirectoryA(name, security); }
+inline bool create_directory(const char *name)
+{
+ interprocess_all_access_security sec;
+ return 0 != CreateDirectoryA(name, sec.get_attributes());
+}
 
 inline bool remove_directory(const char *lpPathName)
 { return 0 != RemoveDirectoryA(lpPathName); }
@@ -626,6 +1070,9 @@
 inline bool write_file(void *hnd, const void *buffer, unsigned long bytes_to_write, unsigned long *bytes_written, interprocess_overlapped* overlapped)
 { return 0 != WriteFile(hnd, buffer, bytes_to_write, bytes_written, overlapped); }
 
+inline bool get_file_information_by_handle(void *hnd, interprocess_by_handle_file_information *info)
+{ return 0 != GetFileInformationByHandle(hnd, info); }
+
 inline long interlocked_increment(long volatile *addr)
 { return BOOST_INTERLOCKED_INCREMENT(addr); }
 
@@ -709,7 +1156,7 @@
    bool bSuccess = false;
 
    // Create a file mapping object.
- void * hFileMap = create_file_mapping(hFile, page_readonly, 0, 1, 0);
+ void * hFileMap = create_file_mapping(hFile, page_readonly, 0, 1, 0, 0);
    if(hFileMap)
    {
       // Create a file mapping to get the file name.
@@ -836,7 +1283,7 @@
 
       //First step: Obtain a handle to the file using Win32 rules. This resolves relative paths
       void *fh = create_file(filename, generic_read | delete_access, open_existing,
- file_flag_backup_semantics | file_flag_delete_on_close);
+ file_flag_backup_semantics | file_flag_delete_on_close, 0);
       if(fh == invalid_handle_value){
          return false;
       }
@@ -953,6 +1400,174 @@
    }
 }
 
+
+inline void get_registry_value(const char *folder, const char *value_key, std::vector<unsigned char> &s)
+{
+ s.clear();
+ void *hAdvapi = load_library("Advapi32.dll");
+ if (hAdvapi){
+ library_unloader unloader(hAdvapi);
+ // Pointer to function RegOpenKeyA
+ RegOpenKeyEx_t pRegOpenKey =
+ (RegOpenKeyEx_t)get_proc_address(hAdvapi, "RegOpenKeyExA");
+ if (pRegOpenKey){
+ // Pointer to function RegCloseKey
+ RegCloseKey_t pRegCloseKey =
+ (RegCloseKey_t)get_proc_address(hAdvapi, "RegCloseKey");
+ if (pRegCloseKey){
+ // Pointer to function RegQueryValueA
+ RegQueryValueEx_t pRegQueryValue =
+ (RegQueryValueEx_t)get_proc_address(hAdvapi, "RegQueryValueExA");
+ if (pRegQueryValue){
+ //Open the key
+ void *key;
+ if ((*pRegOpenKey)( hkey_local_machine
+ , folder
+ , 0
+ , key_query_value
+ , &key) == 0){
+ reg_closer key_closer(pRegCloseKey, key);
+
+ //Obtain the value
+ unsigned long size;
+ unsigned long type;
+ const char *const reg_value = value_key;
+ long err = (*pRegQueryValue)( key, reg_value, 0, &type, 0, &size);
+ if(!err){
+ //Size includes terminating NULL
+ s.resize(size);
+ err = (*pRegQueryValue)( key, reg_value, 0, &type, (unsigned char*)(&s[0]), &size);
+ if(!err)
+ s.erase(s.end()-1);
+ (void)err;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+inline bool get_wmi_class_attribute( std::wstring& strValue, const wchar_t *wmi_class, const wchar_t *wmi_class_var)
+{
+ CoInitialize(0);
+
+ bool bRet = false;
+
+ if( 0 == CoInitializeSecurity( 0, -1, 0, 0, RPC_C_AUTHN_LEVEL_PKT_IG, RPC_C_IMP_LEVEL_IMPERSONATE_IG, 0, EOAC_NONE_IG, 0 ) )
+ {
+ IWbemLocator_IG * pIWbemLocator = 0;
+
+ IWbemServices_IG * pWbemServices = 0;
+ IEnumWbemClassObject_IG * pEnumObject = 0;
+
+ const wchar_t * bstrNamespace = L"root\\cimv2";
+
+ if( 0 != CoCreateInstance(
+ CLSID_WbemAdministrativeLocator,
+ 0,
+ CLSCTX_INPROC_SERVER_IG | CLSCTX_LOCAL_SERVER_IG,
+ IID_IUnknown,
+ ( void ** )&pIWbemLocator
+ )
+ )
+ {
+ return false;
+ }
+
+ if( 0 != pIWbemLocator->ConnectServer(
+ bstrNamespace, // Namespace
+ 0, // Userid
+ 0, // PW
+ 0, // Locale
+ 0, // flags
+ 0, // Authority
+ 0, // Context
+ &pWbemServices
+ )
+ )
+ {
+ pIWbemLocator->Release();
+
+ return false;
+ }
+
+ strValue.clear();
+ strValue += L"Select ";
+ strValue += wmi_class_var;
+ strValue += L" from ";
+ strValue += wmi_class;
+
+ if ( 0 != pWbemServices->ExecQuery(
+ L"WQL",
+ strValue.c_str(),
+ WBEM_FLAG_RETURN_IMMEDIATELY_IG,
+ 0,
+ &pEnumObject
+ )
+ )
+ {
+ pIWbemLocator->Release();
+ pWbemServices->Release();
+
+ return false;
+ }
+
+ unsigned long uCount = 1, uReturned;
+ IWbemClassObject_IG * pClassObject = 0;
+
+ if ( 0 != pEnumObject->Reset() )
+ {
+ pIWbemLocator->Release();
+ pWbemServices->Release();
+ pEnumObject->Release();
+
+ return false;
+ }
+
+ wchar_variant vwchar;
+
+ while( 0 == pEnumObject->Next( WBEM_INFINITE_IG, uCount, &pClassObject, &uReturned ) )
+ {
+ if ( 0 == pClassObject->Get( L"LastBootUpTime", 0, &vwchar, 0, 0 ) )
+ {
+ bRet = true;
+ strValue = vwchar.value.pbstrVal;
+ VariantClear(&vwchar );
+ break;
+ }
+ }
+
+ pIWbemLocator->Release();
+ pWbemServices->Release();
+ pEnumObject->Release();
+ pClassObject->Release();
+ }
+
+ CoUninitialize();
+
+ return bRet;
+}
+
+inline bool get_last_bootup_time( std::wstring& strValue )
+{
+ bool ret = get_wmi_class_attribute(strValue, L"Win32_OperatingSystem", L"LastBootUpTime");
+ strValue.erase(strValue.find(L'+'));
+ return ret;
+}
+
+inline bool get_last_bootup_time( std::string& str )
+{
+ std::wstring wstr;
+ bool ret = get_last_bootup_time(wstr);
+ str.resize(wstr.size());
+ for(std::size_t i = 0, max = str.size(); i != max; ++i){
+ str[i] = '0' + (wstr[i]-L'0');
+ }
+ return ret;
+}
+
+
 } //namespace winapi
 } //namespace interprocess
 } //namespace boost

Modified: branches/release/boost/interprocess/detail/workaround.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/workaround.hpp (original)
+++ branches/release/boost/interprocess/detail/workaround.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -46,8 +46,9 @@
    # if defined(__CYGWIN__)
       #define BOOST_INTERPROCESS_POSIX_SEMAPHORES_NO_UNLINK
    # endif
- //#elif defined(__APPLE__)
- //# define BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES
+ //Some platforms have a limited (name length) named semaphore support
+ #elif (defined(__FreeBSD__) && (__FreeBSD__ >= 4)) || defined(__APPLE__)
+ # define BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES
    #endif
 
    #if ((defined _V6_ILP32_OFFBIG) &&(_V6_ILP32_OFFBIG - 0 > 0)) ||\
@@ -98,7 +99,7 @@
       //portable "/shmname" format does not work due to permission issues
       //For those systems we need to form a path to a temporary directory:
       // hp-ux tru64 vms freebsd
- #if defined(__hpux) || defined(__osf__) || defined(__vms) || (defined(__FreeBSD__) && (__FreeBSD__ < 8))
+ #if defined(__hpux) || defined(__osf__) || defined(__vms) || (defined(__FreeBSD__) && (__FreeBSD__ < 7))
       #define BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SHARED_MEMORY
       #endif
    #endif
@@ -115,7 +116,7 @@
 
 #endif
 
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)\
+#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_NO_VARIADIC_TEMPLATES)\
     && !defined(BOOST_INTERPROCESS_DISABLE_VARIADIC_TMPL)
 #define BOOST_INTERPROCESS_PERFECT_FORWARDING
 #endif

Modified: branches/release/boost/interprocess/detail/xsi_shared_memory_device.hpp
==============================================================================
--- branches/release/boost/interprocess/detail/xsi_shared_memory_device.hpp (original)
+++ branches/release/boost/interprocess/detail/xsi_shared_memory_device.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -197,9 +197,11 @@
    (mapped_region &reg, xsi_named_mutex &mut, std::string &path)
 {
    const char *const filename = "xsi_shm_emulation_file";
+ permissions p;
+ p.set_unrestricted();
    std::string xsi_shm_emulation_file_path;
- detail::create_tmp_dir_and_get_filename(filename, xsi_shm_emulation_file_path);
- detail::create_or_open_file(xsi_shm_emulation_file_path.c_str());
+ detail::create_tmp_and_clean_old_and_get_filename(filename, xsi_shm_emulation_file_path);
+ detail::create_or_open_file(xsi_shm_emulation_file_path.c_str(), read_write, p);
    const std::size_t MemSize = sizeof(info_t);
 
    xsi_shared_memory index_shm(open_or_create, xsi_shm_emulation_file_path.c_str(), 1, MemSize, 0666);

Modified: branches/release/boost/interprocess/exceptions.hpp
==============================================================================
--- branches/release/boost/interprocess/exceptions.hpp (original)
+++ branches/release/boost/interprocess/exceptions.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -33,30 +33,34 @@
 class interprocess_exception : public std::exception
 {
    public:
- interprocess_exception(error_code_t ec = other_error )
- : m_err(ec)
+ interprocess_exception(const char *err/*error_code_t ec = other_error*/)
+ : m_err(other_error)
    {
- try { m_str = "boost::interprocess_exception::library_error"; }
+// try { m_str = "boost::interprocess_exception::library_error"; }
+ try { m_str = err; }
       catch (...) {}
    }
-
+/*
    interprocess_exception(native_error_t sys_err_code)
       : m_err(sys_err_code)
    {
       try { fill_system_message(m_err.get_native_error(), m_str); }
       catch (...) {}
- }
+ }*/
 
- interprocess_exception(const error_info &err_info)
+ interprocess_exception(const error_info &err_info, const char *str = 0)
       : m_err(err_info)
    {
       try{
          if(m_err.get_native_error() != 0){
             fill_system_message(m_err.get_native_error(), m_str);
- }/*
+ }
+ else if(str){
+ m_str = str;
+ }
          else{
             m_str = "boost::interprocess_exception::library_error";
- }*/
+ }
       }
       catch(...){}
    }
@@ -132,7 +136,8 @@
 class bad_alloc : public interprocess_exception
 {
  public:
- virtual const char* what() const throw()
+ bad_alloc() : interprocess_exception("::boost::interprocess::bad_alloc"){}
+ virtual const char* what() const throw()
       { return "boost::interprocess::bad_alloc"; }
 };
 

Modified: branches/release/boost/interprocess/interprocess_fwd.hpp
==============================================================================
--- branches/release/boost/interprocess/interprocess_fwd.hpp (original)
+++ branches/release/boost/interprocess/interprocess_fwd.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -56,6 +56,12 @@
 namespace boost { namespace interprocess {
 
 //////////////////////////////////////////////////////////////////////////////
+// permissions
+//////////////////////////////////////////////////////////////////////////////
+
+class permissions;
+
+//////////////////////////////////////////////////////////////////////////////
 // shared_memory
 //////////////////////////////////////////////////////////////////////////////
 

Modified: branches/release/boost/interprocess/ipc/message_queue.hpp
==============================================================================
--- branches/release/boost/interprocess/ipc/message_queue.hpp (original)
+++ branches/release/boost/interprocess/ipc/message_queue.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -22,6 +22,7 @@
 #include <boost/interprocess/offset_ptr.hpp>
 #include <boost/interprocess/creation_tags.hpp>
 #include <boost/interprocess/exceptions.hpp>
+#include <boost/interprocess/permissions.hpp>
 #include <boost/detail/no_exceptions_support.hpp>
 #include <boost/interprocess/detail/type_traits.hpp>
 
@@ -56,7 +57,8 @@
    message_queue(create_only_t create_only,
                  const char *name,
                  std::size_t max_num_msg,
- std::size_t max_msg_size);
+ std::size_t max_msg_size,
+ const permissions &perm = permissions());
 
    //!Opens or creates a process shared message queue with name "name".
    //!If the queue is created, the maximum number of messages will be "max_num_msg"
@@ -66,7 +68,8 @@
    message_queue(open_or_create_t open_or_create,
                  const char *name,
                  std::size_t max_num_msg,
- std::size_t max_msg_size);
+ std::size_t max_msg_size,
+ const permissions &perm = permissions());
 
    //!Opens a previously created process shared message queue with name "name".
    //!If the was not previously created or there are no free resources,
@@ -379,7 +382,8 @@
 inline message_queue::message_queue(create_only_t create_only,
                                     const char *name,
                                     std::size_t max_num_msg,
- std::size_t max_msg_size)
+ std::size_t max_msg_size,
+ const permissions &perm)
       //Create shared memory and execute functor atomically
    : m_shmem(create_only,
               name,
@@ -387,13 +391,15 @@
               read_write,
               static_cast<void*>(0),
               //Prepare initialization functor
- detail::initialization_func_t (max_num_msg, max_msg_size))
+ detail::initialization_func_t (max_num_msg, max_msg_size),
+ perm)
 {}
 
 inline message_queue::message_queue(open_or_create_t open_or_create,
                                     const char *name,
                                     std::size_t max_num_msg,
- std::size_t max_msg_size)
+ std::size_t max_msg_size,
+ const permissions &perm)
       //Create shared memory and execute functor atomically
    : m_shmem(open_or_create,
               name,
@@ -401,7 +407,8 @@
               read_write,
               static_cast<void*>(0),
               //Prepare initialization functor
- detail::initialization_func_t (max_num_msg, max_msg_size))
+ detail::initialization_func_t (max_num_msg, max_msg_size),
+ perm)
 {}
 
 inline message_queue::message_queue(open_only_t open_only,
@@ -474,14 +481,14 @@
                while (p_hdr->is_full());
             break;
             default:
- throw interprocess_exception();
+ break;
          }
       }
       
       //Get the first free message from free message queue
       detail::msg_hdr_t *free_msg = p_hdr->free_msg();
       if (free_msg == 0) {
- throw interprocess_exception();
+ throw interprocess_exception("boost::interprocess::message_queue corrupted");
       }
 
       //Copy control data to the free message
@@ -568,7 +575,7 @@
 
             //Paranoia check
             default:
- throw interprocess_exception();
+ break;
          }
       }
 
@@ -577,7 +584,7 @@
 
       //Paranoia check
       if (top_msg == 0) {
- throw interprocess_exception();
+ throw interprocess_exception("boost::interprocess::message_queue corrupted");
       }
 
       //Get data from the message

Modified: branches/release/boost/interprocess/managed_external_buffer.hpp
==============================================================================
--- branches/release/boost/interprocess/managed_external_buffer.hpp (original)
+++ branches/release/boost/interprocess/managed_external_buffer.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -20,7 +20,7 @@
 #include <boost/interprocess/creation_tags.hpp>
 #include <boost/interprocess/detail/managed_memory_impl.hpp>
 #include <boost/interprocess/detail/move.hpp>
-#include <cassert>
+#include <boost/assert.hpp>
 
 //!\file
 //!Describes a named user memory allocation user class.
@@ -58,9 +58,9 @@
       (create_only_t, void *addr, std::size_t size)
    {
       //Check if alignment is correct
- assert((0 == (((std::size_t)addr) & (AllocationAlgorithm::Alignment - std::size_t(1u)))));
+ BOOST_ASSERT((0 == (((std::size_t)addr) & (AllocationAlgorithm::Alignment - std::size_t(1u)))));
       if(!base_t::create_impl(addr, size)){
- throw interprocess_exception();
+ throw interprocess_exception("Could not initialize buffer in basic_managed_external_buffer constructor");
       }
    }
 
@@ -69,9 +69,9 @@
       (open_only_t, void *addr, std::size_t size)
    {
       //Check if alignment is correct
- assert((0 == (((std::size_t)addr) & (AllocationAlgorithm::Alignment - std::size_t(1u)))));
+ BOOST_ASSERT((0 == (((std::size_t)addr) & (AllocationAlgorithm::Alignment - std::size_t(1u)))));
       if(!base_t::open_impl(addr, size)){
- throw interprocess_exception();
+ throw interprocess_exception("Could not initialize buffer in basic_managed_external_buffer constructor");
       }
    }
 

Modified: branches/release/boost/interprocess/managed_heap_memory.hpp
==============================================================================
--- branches/release/boost/interprocess/managed_heap_memory.hpp (original)
+++ branches/release/boost/interprocess/managed_heap_memory.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -67,7 +67,7 @@
    {
       if(!base_t::create_impl(&m_heapmem[0], size)){
          this->priv_close();
- throw interprocess_exception();
+ throw interprocess_exception("Could not initialize heap in basic_managed_heap_memory constructor");
       }
    }
 

Modified: branches/release/boost/interprocess/managed_mapped_file.hpp
==============================================================================
--- branches/release/boost/interprocess/managed_mapped_file.hpp (original)
+++ branches/release/boost/interprocess/managed_mapped_file.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -23,6 +23,7 @@
 #include <boost/interprocess/detail/file_wrapper.hpp>
 #include <boost/interprocess/detail/move.hpp>
 #include <boost/interprocess/file_mapping.hpp>
+#include <boost/interprocess/permissions.hpp>
 
 namespace boost {
 namespace interprocess {
@@ -71,9 +72,9 @@
    //!Creates mapped file and creates and places the segment manager.
    //!This can throw.
    basic_managed_mapped_file(create_only_t create_only, const char *name,
- std::size_t size, const void *addr = 0)
+ std::size_t size, const void *addr = 0, const permissions &perm = permissions())
       : m_mfile(create_only, name, size, read_write, addr,
- create_open_func_t(get_this_pointer(), detail::DoCreate))
+ create_open_func_t(get_this_pointer(), detail::DoCreate), perm)
    {}
 
    //!Creates mapped file and creates and places the segment manager if
@@ -82,17 +83,17 @@
    //!This can throw.
    basic_managed_mapped_file (open_or_create_t open_or_create,
                               const char *name, std::size_t size,
- const void *addr = 0)
- : m_mfile(open_or_create, name, size, read_write, addr,
+ const void *addr = 0, const permissions &perm = permissions())
+ : m_mfile(open_or_create, name, size, read_write, addr,
                 create_open_func_t(get_this_pointer(),
- detail::DoOpenOrCreate))
+ detail::DoOpenOrCreate), perm)
    {}
 
    //!Connects to a created mapped file and its segment manager.
    //!This can throw.
    basic_managed_mapped_file (open_only_t open_only, const char* name,
                               const void *addr = 0)
- : m_mfile(open_only, name, read_write, addr,
+ : m_mfile(open_only, name, read_write, addr,
                 create_open_func_t(get_this_pointer(),
                 detail::DoOpen))
    {}

Modified: branches/release/boost/interprocess/managed_shared_memory.hpp
==============================================================================
--- branches/release/boost/interprocess/managed_shared_memory.hpp (original)
+++ branches/release/boost/interprocess/managed_shared_memory.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -19,9 +19,11 @@
 #include <boost/interprocess/detail/workaround.hpp>
 
 #include <boost/interprocess/detail/managed_memory_impl.hpp>
+#include <boost/interprocess/exceptions.hpp>
 #include <boost/interprocess/detail/managed_open_or_create_impl.hpp>
 #include <boost/interprocess/shared_memory_object.hpp>
 #include <boost/interprocess/creation_tags.hpp>
+#include <boost/interprocess/permissions.hpp>
 
 namespace boost {
 
@@ -82,10 +84,10 @@
    //!Creates shared memory and creates and places the segment manager.
    //!This can throw.
    basic_managed_shared_memory(create_only_t create_only, const char *name,
- std::size_t size, const void *addr = 0)
+ std::size_t size, const void *addr = 0, const permissions& perm = permissions())
       : base_t()
       , base2_t(create_only, name, size, read_write, addr,
- create_open_func_t(get_this_pointer(), detail::DoCreate))
+ create_open_func_t(get_this_pointer(), detail::DoCreate), perm)
    {}
 
    //!Creates shared memory and creates and places the segment manager if
@@ -94,11 +96,11 @@
    //!This can throw.
    basic_managed_shared_memory (open_or_create_t open_or_create,
                               const char *name, std::size_t size,
- const void *addr = 0)
+ const void *addr = 0, const permissions& perm = permissions())
       : base_t()
       , base2_t(open_or_create, name, size, read_write, addr,
                 create_open_func_t(get_this_pointer(),
- detail::DoOpenOrCreate))
+ detail::DoOpenOrCreate), perm)
    {}
 
    //!Connects to a created shared memory and its segment manager.
@@ -180,6 +182,11 @@
          <basic_managed_shared_memory>(shmname);
    }
 
+ bool flush()
+ {
+ return this->base2_t::flush();
+ }
+
    /// @cond
 
    //!Tries to find a previous named allocation address. Returns a memory

Modified: branches/release/boost/interprocess/managed_windows_shared_memory.hpp
==============================================================================
--- branches/release/boost/interprocess/managed_windows_shared_memory.hpp (original)
+++ branches/release/boost/interprocess/managed_windows_shared_memory.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -21,6 +21,7 @@
 #include <boost/interprocess/detail/managed_memory_impl.hpp>
 #include <boost/interprocess/creation_tags.hpp>
 #include <boost/interprocess/windows_shared_memory.hpp>
+#include <boost/interprocess/permissions.hpp>
 #include <boost/interprocess/detail/move.hpp>
 
 namespace boost {
@@ -74,9 +75,9 @@
    //!This can throw.
    basic_managed_windows_shared_memory
       (create_only_t create_only, const char *name,
- std::size_t size, const void *addr = 0)
+ std::size_t size, const void *addr = 0, const permissions &perm = permissions())
       : m_wshm(create_only, name, size, read_write, addr,
- create_open_func_t(get_this_pointer(), detail::DoCreate))
+ create_open_func_t(get_this_pointer(), detail::DoCreate), perm)
    {}
 
    //!Creates shared memory and creates and places the segment manager if
@@ -86,10 +87,11 @@
    basic_managed_windows_shared_memory
       (open_or_create_t open_or_create,
       const char *name, std::size_t size,
- const void *addr = 0)
+ const void *addr = 0,
+ const permissions &perm = permissions())
       : m_wshm(open_or_create, name, size, read_write, addr,
                 create_open_func_t(get_this_pointer(),
- detail::DoOpenOrCreate))
+ detail::DoOpenOrCreate), perm)
    {}
 
    //!Connects to a created shared memory and its segment manager.

Modified: branches/release/boost/interprocess/mapped_region.hpp
==============================================================================
--- branches/release/boost/interprocess/mapped_region.hpp (original)
+++ branches/release/boost/interprocess/mapped_region.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -34,7 +34,7 @@
 # if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS)
 # include <sys/shm.h> //System V shared memory...
 # endif
-# include <cassert>
+# include <boost/assert.hpp>
 # else
 # error Unknown platform
 # endif
@@ -42,7 +42,7 @@
 #endif //#if (defined BOOST_INTERPROCESS_WINDOWS)
 
 //!\file
-//!Describes memory_mappable and mapped region classes
+//!Describes mapped region class
 
 namespace boost {
 namespace interprocess {
@@ -81,7 +81,17 @@
 
    //!Move constructor. *this will be constructed taking ownership of "other"'s
    //!region and "other" will be left in default constructor state.
- mapped_region(BOOST_INTERPROCESS_RV_REF(mapped_region) other);
+ mapped_region(BOOST_INTERPROCESS_RV_REF(mapped_region) other)
+ #if defined (BOOST_INTERPROCESS_WINDOWS)
+ : m_base(0), m_size(0), m_offset(0)
+ , m_extra_offset(0)
+ , m_mode(read_only)
+ , m_file_mapping_hnd(detail::invalid_file())
+ #else
+ : m_base(MAP_FAILED), m_size(0), m_offset(0), m_extra_offset(0), m_mode(read_only), m_is_xsi(false)
+ #endif
+ { this->swap(other); }
+
 
    //!Destroys the mapped region.
    //!Does not throw
@@ -89,7 +99,12 @@
 
    //!Move assignment. If *this owns a memory mapped region, it will be
    //!destroyed and it will take ownership of "other"'s memory mapped region.
- mapped_region &operator=(BOOST_INTERPROCESS_RV_REF(mapped_region) other);
+ mapped_region &operator=(BOOST_INTERPROCESS_RV_REF(mapped_region) other)
+ {
+ mapped_region tmp(boost::interprocess::move(other));
+ this->swap(tmp);
+ return *this;
+ }
 
    //!Returns the size of the mapping. Note for windows users: If
    //!windows_shared_memory is mapped using 0 as the size, it returns 0
@@ -154,13 +169,6 @@
 inline void swap(mapped_region &x, mapped_region &y)
 { x.swap(y); }
 
-inline mapped_region &mapped_region::operator=(BOOST_INTERPROCESS_RV_REF(mapped_region) moved)
-{
- mapped_region tmp(boost::interprocess::move(moved));
- this->swap(tmp);
- return *this;
-}
-
 inline mapped_region::~mapped_region()
 { this->priv_close(); }
 
@@ -176,20 +184,13 @@
 inline void* mapped_region::get_address() const
 { return m_base; }
 
-#if (defined BOOST_INTERPROCESS_WINDOWS)
+#if defined (BOOST_INTERPROCESS_WINDOWS)
 
 inline mapped_region::mapped_region()
    : m_base(0), m_size(0), m_offset(0), m_extra_offset(0), m_mode(read_only)
    , m_file_mapping_hnd(detail::invalid_file())
 {}
 
-inline mapped_region::mapped_region(BOOST_INTERPROCESS_RV_REF(mapped_region) other)
- : m_base(0), m_size(0), m_offset(0)
- , m_extra_offset(0)
- , m_mode(read_only)
- , m_file_mapping_hnd(detail::invalid_file())
-{ this->swap(other); }
-
 template<int dummy>
 inline std::size_t mapped_region::page_size_holder<dummy>::get_page_size()
 {
@@ -218,6 +219,7 @@
    switch(mode)
    {
       case read_only:
+ case read_private:
          file_map_access |= winapi::page_readonly;
          map_access |= winapi::file_map_read;
       break;
@@ -259,7 +261,7 @@
       //Create file mapping
       native_mapping_handle =
          winapi::create_file_mapping
- (detail::file_handle_from_mapping_handle(mapping.get_mapping_handle()), file_map_access, 0, 0, 0);
+ (detail::file_handle_from_mapping_handle(mapping.get_mapping_handle()), file_map_access, 0, 0, 0, 0);
 
       //Check if all is correct
       if(!native_mapping_handle){
@@ -350,7 +352,7 @@
    }
 
    //Flush it all
- return 0 == winapi::flush_view_of_file
+ return winapi::flush_view_of_file
       (static_cast<char*>(m_base)+mapping_offset,
        static_cast<std::size_t>(numbytes));
 }
@@ -378,10 +380,6 @@
    : m_base(MAP_FAILED), m_size(0), m_offset(0), m_extra_offset(0), m_mode(read_only), m_is_xsi(false)
 {}
 
-inline mapped_region::mapped_region(BOOST_INTERPROCESS_RV_REF(mapped_region) other)
- : m_base(MAP_FAILED), m_size(0), m_offset(0), m_extra_offset(0), m_mode(read_only), m_is_xsi(false)
-{ this->swap(other); }
-
 template<int dummy>
 inline std::size_t mapped_region::page_size_holder<dummy>::get_page_size()
 { return std::size_t(sysconf(_SC_PAGESIZE)); }
@@ -467,6 +465,11 @@
          flags |= MAP_SHARED;
       break;
 
+ case read_private:
+ prot |= (PROT_READ);
+ flags |= MAP_PRIVATE;
+ break;
+
       case read_write:
          prot |= (PROT_WRITE | PROT_READ);
          flags |= MAP_SHARED;
@@ -538,7 +541,7 @@
    }
    //Flush it all
    return msync(static_cast<char*>(m_base)+mapping_offset,
- numbytes, MS_SYNC) == 0;
+ numbytes, MS_ASYNC) == 0;
 }
 
 inline void mapped_region::priv_close()
@@ -547,7 +550,7 @@
       #ifdef BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS
       if(m_is_xsi){
          int ret = ::shmdt(m_base);
- assert(ret == 0);
+ BOOST_ASSERT(ret == 0);
          (void)ret;
          return;
       }

Modified: branches/release/boost/interprocess/mem_algo/detail/mem_algo_common.hpp
==============================================================================
--- branches/release/boost/interprocess/mem_algo/detail/mem_algo_common.hpp (original)
+++ branches/release/boost/interprocess/mem_algo/detail/mem_algo_common.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -31,6 +31,7 @@
 #include <algorithm>
 #include <utility>
 #include <iterator>
+#include <boost/assert.hpp>
 
 //!\file
 //!Implements common operations for memory algorithms.
@@ -119,7 +120,7 @@
          //biggest of all possibilities
          current_forward = detail::get_truncated_size_po2(received_size, backwards_multiple);
          needs_backwards = size_to_achieve - current_forward;
- assert((needs_backwards % backwards_multiple) == 0);
+ BOOST_ASSERT((needs_backwards % backwards_multiple) == 0);
          needs_backwards_lcmed = detail::get_rounded_size_po2(needs_backwards, lcm);
          lcm_out = lcm;
          needs_backwards_lcmed_out = needs_backwards_lcmed;
@@ -131,7 +132,7 @@
          current_forward = detail::get_truncated_size(received_size, backwards_multiple);
          //No need to round needs_backwards because backwards_multiple == lcm
          needs_backwards_lcmed = needs_backwards = size_to_achieve - current_forward;
- assert((needs_backwards_lcmed & (Alignment - 1u)) == 0);
+ BOOST_ASSERT((needs_backwards_lcmed & (Alignment - 1u)) == 0);
          lcm_out = lcm;
          needs_backwards_lcmed_out = needs_backwards_lcmed;
          return true;
@@ -144,7 +145,7 @@
          if(0 != (needs_backwards_lcmed & (Alignment-1)))
          //while(0 != (needs_backwards_lcmed & (Alignment-1)))
             needs_backwards_lcmed += backwards_multiple;
- assert((needs_backwards_lcmed % lcm) == 0);
+ BOOST_ASSERT((needs_backwards_lcmed % lcm) == 0);
          lcm_out = lcm;
          needs_backwards_lcmed_out = needs_backwards_lcmed;
          return true;
@@ -165,7 +166,7 @@
                needs_backwards_lcmed += (4-remainder)*backwards_multiple;
             }
          }
- assert((needs_backwards_lcmed % lcm) == 0);
+ BOOST_ASSERT((needs_backwards_lcmed % lcm) == 0);
          lcm_out = lcm;
          needs_backwards_lcmed_out = needs_backwards_lcmed;
          return true;
@@ -178,7 +179,7 @@
       //biggest of all possibilities
       current_forward = detail::get_truncated_size(received_size, backwards_multiple);
       needs_backwards = size_to_achieve - current_forward;
- assert((needs_backwards % backwards_multiple) == 0);
+ BOOST_ASSERT((needs_backwards % backwards_multiple) == 0);
       needs_backwards_lcmed = detail::get_rounded_size(needs_backwards, lcm);
       lcm_out = lcm;
       needs_backwards_lcmed_out = needs_backwards_lcmed;
@@ -279,9 +280,9 @@
       //Now obtain the address of the blocks
       block_ctrl *first = memory_algo->priv_get_block(buffer);
       block_ctrl *second = memory_algo->priv_get_block(pos);
- assert(pos <= (reinterpret_cast<char*>(first) + first->m_size*Alignment));
- assert(first->m_size >= 2*MinBlockUnits);
- assert((pos + MinBlockUnits*Alignment - AllocatedCtrlBytes + nbytes*Alignment/Alignment) <=
+ BOOST_ASSERT(pos <= (reinterpret_cast<char*>(first) + first->m_size*Alignment));
+ BOOST_ASSERT(first->m_size >= 2*MinBlockUnits);
+ BOOST_ASSERT((pos + MinBlockUnits*Alignment - AllocatedCtrlBytes + nbytes*Alignment/Alignment) <=
              (reinterpret_cast<char*>(first) + first->m_size*Alignment));
       //Set the new size of the first block
       std::size_t old_size = first->m_size;
@@ -314,7 +315,7 @@
       }
       else{
          second->m_size = old_size - first->m_size;
- assert(second->m_size >= MinBlockUnits);
+ BOOST_ASSERT(second->m_size >= MinBlockUnits);
          memory_algo->priv_mark_new_allocated_block(second);
       }
 
@@ -517,7 +518,7 @@
             block_address += new_block->m_size*Alignment;
             total_used_units += new_block->m_size;
             //Check we have enough room to overwrite the intrusive pointer
- assert((new_block->m_size*Alignment - AllocatedCtrlUnits) >= sizeof(void_pointer));
+ BOOST_ASSERT((new_block->m_size*Alignment - AllocatedCtrlUnits) >= sizeof(void_pointer));
             void_pointer p = new(memory_algo->priv_get_user_buffer(new_block))void_pointer(0);
             chain.push_back(p);
             ++low_idx;

Modified: branches/release/boost/interprocess/mem_algo/detail/multi_simple_seq_fit_impl.hpp
==============================================================================
--- branches/release/boost/interprocess/mem_algo/detail/multi_simple_seq_fit_impl.hpp (original)
+++ branches/release/boost/interprocess/mem_algo/detail/multi_simple_seq_fit_impl.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -35,7 +35,7 @@
 #include <utility>
 #include <cstring>
 
-#include <assert.h>
+#include <boost/assert.hpp>
 #include <new>
 
 /*!\file
@@ -247,8 +247,8 @@
 inline simple_seq_fit_impl<MutexFamily, VoidPointer>::~simple_seq_fit_impl()
 {
    //There is a memory leak!
-// assert(m_header.m_allocated == 0);
-// assert(m_header.m_root.m_next->m_next == block_ctrl_ptr(&m_header.m_root));
+// BOOST_ASSERT(m_header.m_allocated == 0);
+// BOOST_ASSERT(m_header.m_root.m_next->m_next == block_ctrl_ptr(&m_header.m_root));
 }
 
 template<class MutexFamily, class VoidPointer>
@@ -279,7 +279,7 @@
 inline void simple_seq_fit_impl<MutexFamily, VoidPointer>::priv_add_segment(void *addr, std::size_t size)
 {
    //Check size
- assert(!(size < MinBlockSize));
+ BOOST_ASSERT(!(size < MinBlockSize));
    if(size < MinBlockSize)
       return;
    //Construct big block using the new segment
@@ -445,7 +445,7 @@
       boost::interprocess::multi_segment_services *p_services =
          static_cast<boost::interprocess::multi_segment_services*>
                      (void_pointer::find_group_data(group));
- assert(p_services);
+ BOOST_ASSERT(p_services);
       std::pair<void *, std::size_t> ret =
          p_services->create_new_segment(MinBlockSize > nbytes ? MinBlockSize : nbytes);
       if(ret.first){
@@ -502,7 +502,7 @@
       if((prev->get_user_bytes()) >= needs_backwards){
          //Now take all next space. This will succeed
          if(!priv_expand(reuse_ptr, received_size, received_size, received_size)){
- assert(0);
+ BOOST_ASSERT(0);
          }
          
          //We need a minimum size to split the previous one
@@ -679,7 +679,7 @@
    std::size_t old_block_size = block->m_size;
 
    //All used blocks' next is marked with 0 so check it
- assert(block->m_next == 0);
+ BOOST_ASSERT(block->m_next == 0);
 
    //Put this to a safe value
    received_size = old_block_size*Alignment - BlockCtrlBytes;
@@ -735,7 +735,7 @@
    if(!this->priv_check_and_allocate (nunits, prev, block, received_size)){
       //Something very ugly is happening here. This is a bug
       //or there is memory corruption
- assert(0);
+ BOOST_ASSERT(0);
       return false;
    }
    return true;
@@ -754,7 +754,7 @@
    std::size_t block_size = block->m_size;
 
    //All used blocks' next is marked with 0 so check it
- assert(block->m_next == 0);
+ BOOST_ASSERT(block->m_next == 0);
 
    //Put this to a safe value
    received_size = block_size*Alignment - BlockCtrlBytes;
@@ -806,7 +806,7 @@
    //Ensure power of 2
    if ((alignment & (alignment - std::size_t(1u))) != 0){
       //Alignment is not power of two
- assert((alignment & (alignment - std::size_t(1u))) != 0);
+ BOOST_ASSERT((alignment & (alignment - std::size_t(1u))) != 0);
       return 0;
    }
 
@@ -885,7 +885,7 @@
       //Mark the block as allocated
       block->m_next = 0;
       //Check alignment
- assert(((reinterpret_cast<char*>(block) - reinterpret_cast<char*>(this))
+ BOOST_ASSERT(((reinterpret_cast<char*>(block) - reinterpret_cast<char*>(this))
                % Alignment) == 0 );
       return reinterpret_cast<char*>(block) + BlockCtrlBytes;
    }
@@ -917,14 +917,14 @@
                            (reinterpret_cast<char*>(addr) - BlockCtrlBytes);
 
    //All used blocks' next is marked with 0 so check it
- assert(block->m_next == 0);
+ BOOST_ASSERT(block->m_next == 0);
 
    //Check if alignment and block size are right
- assert((reinterpret_cast<char*>(addr) - reinterpret_cast<char*>(this))
+ BOOST_ASSERT((reinterpret_cast<char*>(addr) - reinterpret_cast<char*>(this))
             % Alignment == 0 );
 
    std::size_t total_size = Alignment*block->m_size;
- assert(m_header.m_allocated >= total_size);
+ BOOST_ASSERT(m_header.m_allocated >= total_size);
   
    //Update used memory count
    m_header.m_allocated -= total_size;

Modified: branches/release/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp
==============================================================================
--- branches/release/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp (original)
+++ branches/release/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -34,7 +34,7 @@
 #include <algorithm>
 #include <utility>
 #include <cstring>
-#include <cassert>
+#include <boost/assert.hpp>
 #include <new>
 
 //!\file
@@ -338,8 +338,8 @@
 inline simple_seq_fit_impl<MutexFamily, VoidPointer>::~simple_seq_fit_impl()
 {
    //There is a memory leak!
-// assert(m_header.m_allocated == 0);
-// assert(m_header.m_root.m_next->m_next == block_ctrl_ptr(&m_header.m_root));
+// BOOST_ASSERT(m_header.m_allocated == 0);
+// BOOST_ASSERT(m_header.m_root.m_next->m_next == block_ctrl_ptr(&m_header.m_root));
 }
 
 template<class MutexFamily, class VoidPointer>
@@ -397,21 +397,21 @@
    //Check if have only 1 big free block
    void *unique_block = 0;
    if(!m_header.m_allocated){
- assert(prev == root);
+ BOOST_ASSERT(prev == root);
       std::size_t ignore;
       unique_block = priv_allocate(boost::interprocess::allocate_new, 0, 0, ignore).first;
       if(!unique_block)
          return;
       last = detail::get_pointer(m_header.m_root.m_next);
- assert(last_free_end_address == (reinterpret_cast<char*>(last) + last->m_size*Alignment));
+ BOOST_ASSERT(last_free_end_address == (reinterpret_cast<char*>(last) + last->m_size*Alignment));
    }
    std::size_t last_units = last->m_size;
 
    std::size_t received_size;
    void *addr = priv_check_and_allocate(last_units, prev, last, received_size);
    (void)addr;
- assert(addr);
- assert(received_size == last_units*Alignment - AllocatedCtrlBytes);
+ BOOST_ASSERT(addr);
+ BOOST_ASSERT(received_size == last_units*Alignment - AllocatedCtrlBytes);
    
    //Shrink it
    m_header.m_size /= Alignment;
@@ -452,7 +452,7 @@
 {
    algo_impl_t::assert_alignment(addr);
    //Check size
- assert(!(size < MinBlockSize));
+ BOOST_ASSERT(!(size < MinBlockSize));
    if(size < MinBlockSize)
       return;
    //Construct big block using the new segment
@@ -595,7 +595,7 @@
                         void *reuse_ptr, std::size_t sizeof_object)
 {
    if(!sizeof_object)
- return std::pair<void *, bool>(static_cast<void*>(0), 0);
+ return std::pair<void *, bool>(static_cast<void*>(0), false);
    if(command & boost::interprocess::try_shrink_in_place){
       bool success = algo_impl_t::try_shrink
          ( this, reuse_ptr, limit_objects*sizeof_object
@@ -690,7 +690,7 @@
       if((prev->get_user_bytes()) >= needs_backwards){
          //Now take all next space. This will succeed
          if(!priv_expand(reuse_ptr, received_size, received_size, received_size)){
- assert(0);
+ BOOST_ASSERT(0);
          }
          
          //We need a minimum size to split the previous one
@@ -819,7 +819,7 @@
          received_size = biggest_block->m_size*Alignment - BlockCtrlUnits;
          void *ret = this->priv_check_and_allocate
             (biggest_block->m_size, prev_biggest_block, biggest_block, received_size);
- assert(ret != 0);
+ BOOST_ASSERT(ret != 0);
          algo_impl_t::assert_alignment(ret);
          return return_type(ret, false);
       }
@@ -914,7 +914,7 @@
    std::size_t old_block_size = block->m_size;
 
    //All used blocks' next is marked with 0 so check it
- assert(block->m_next == 0);
+ BOOST_ASSERT(block->m_next == 0);
 
    //Put this to a safe value
    received_size = old_block_size*Alignment - BlockCtrlBytes;
@@ -970,7 +970,7 @@
    if(!this->priv_check_and_allocate (nunits, prev, block, received_size)){
       //Something very ugly is happening here. This is a bug
       //or there is memory corruption
- assert(0);
+ BOOST_ASSERT(0);
       return false;
    }
    return true;
@@ -1045,13 +1045,13 @@
    block_ctrl * block = reinterpret_cast<block_ctrl*>(priv_get_block(addr));
 
    //All used blocks' next is marked with 0 so check it
- assert(block->m_next == 0);
+ BOOST_ASSERT(block->m_next == 0);
 
    //Check if alignment and block size are right
    algo_impl_t::assert_alignment(addr);
 
    std::size_t total_size = Alignment*block->m_size;
- assert(m_header.m_allocated >= total_size);
+ BOOST_ASSERT(m_header.m_allocated >= total_size);
   
    //Update used memory count
    m_header.m_allocated -= total_size;

Modified: branches/release/boost/interprocess/mem_algo/rbtree_best_fit.hpp
==============================================================================
--- branches/release/boost/interprocess/mem_algo/rbtree_best_fit.hpp (original)
+++ branches/release/boost/interprocess/mem_algo/rbtree_best_fit.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -37,10 +37,11 @@
 #include <algorithm>
 #include <utility>
 #include <climits>
+#include <boost/assert.hpp>
 #include <cstring>
 #include <iterator>
 
-#include <cassert>
+#include <boost/assert.hpp>
 #include <new>
 
 #include <boost/intrusive/set.hpp>
@@ -368,7 +369,7 @@
 
    //Now write calculate the offset of the first big block that will
    //cover the whole segment
- assert(get_min_size(extra_hdr_bytes) <= size);
+ BOOST_ASSERT(get_min_size(extra_hdr_bytes) <= size);
    std::size_t block1_off = priv_first_block_offset(this, extra_hdr_bytes);
    priv_add_segment(reinterpret_cast<char*>(this) + block1_off, size - block1_off);
 }
@@ -377,8 +378,8 @@
 inline rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::~rbtree_best_fit()
 {
    //There is a memory leak!
-// assert(m_header.m_allocated == 0);
-// assert(m_header.m_root.m_next->m_next == block_ctrl_ptr(&m_header.m_root));
+// BOOST_ASSERT(m_header.m_allocated == 0);
+// BOOST_ASSERT(m_header.m_root.m_next->m_next == block_ctrl_ptr(&m_header.m_root));
 }
 
 template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
@@ -391,7 +392,7 @@
    block_ctrl *first_block = reinterpret_cast<block_ctrl *>
                                  (reinterpret_cast<char*>(this) + block1_off);
    block_ctrl *old_end_block = priv_end_block(first_block);
- assert(priv_is_allocated_block(old_end_block));
+ BOOST_ASSERT(priv_is_allocated_block(old_end_block));
    std::size_t old_border_offset = (reinterpret_cast<char*>(old_end_block) -
                                     reinterpret_cast<char*>(this)) + EndCtrlBlockBytes;
 
@@ -399,7 +400,7 @@
    m_header.m_size += extra_size;
 
    //We need at least MinBlockUnits blocks to create a new block
-// assert((m_header.m_size - old_end) >= MinBlockUnits);
+// BOOST_ASSERT((m_header.m_size - old_end) >= MinBlockUnits);
    if((m_header.m_size - old_border_offset) < MinBlockUnits){
       return;
    }
@@ -411,18 +412,18 @@
    new_end_block->m_size = (reinterpret_cast<char*>(first_block) -
                                  reinterpret_cast<char*>(new_end_block))/Alignment;
    first_block->m_prev_size = new_end_block->m_size;
- assert(first_block == priv_next_block(new_end_block));
+ BOOST_ASSERT(first_block == priv_next_block(new_end_block));
    priv_mark_new_allocated_block(new_end_block);
    
- assert(new_end_block == priv_end_block(first_block));
+ BOOST_ASSERT(new_end_block == priv_end_block(first_block));
 
    //The old end block is the new block
    block_ctrl *new_block = old_end_block;
    new_block->m_size = (reinterpret_cast<char*>(new_end_block) -
                         reinterpret_cast<char*>(new_block))/Alignment;
- assert(new_block->m_size >= BlockCtrlUnits);
+ BOOST_ASSERT(new_block->m_size >= BlockCtrlUnits);
    priv_mark_new_allocated_block(new_block);
- assert(priv_next_block(new_block) == new_end_block);
+ BOOST_ASSERT(priv_next_block(new_block) == new_end_block);
 
    m_header.m_allocated += new_block->m_size*Alignment;
 
@@ -443,7 +444,7 @@
 
    block_ctrl *old_end_block = priv_end_block(first_block);
    algo_impl_t::assert_alignment(old_end_block);
- assert(priv_is_allocated_block(old_end_block));
+ BOOST_ASSERT(priv_is_allocated_block(old_end_block));
 
    algo_impl_t::assert_alignment(old_end_block);
 
@@ -458,10 +459,10 @@
          return;
       algo_impl_t::assert_alignment(unique_buffer);
       block_ctrl *unique_block = priv_get_block(unique_buffer);
- assert(priv_is_allocated_block(unique_block));
+ BOOST_ASSERT(priv_is_allocated_block(unique_block));
       algo_impl_t::assert_alignment(unique_block);
       last_block = priv_next_block(unique_block);
- assert(!priv_is_allocated_block(last_block));
+ BOOST_ASSERT(!priv_is_allocated_block(last_block));
       algo_impl_t::assert_alignment(last_block);
    }
    else{
@@ -487,7 +488,7 @@
    //store the offset to the end block since in the previous
    //offset can't be overwritten by a previous block
    first_block->m_prev_size = new_end_block->m_size;
- assert(priv_end_block(first_block) == new_end_block);
+ BOOST_ASSERT(priv_end_block(first_block) == new_end_block);
 
    //Update managed buffer's size
    m_header.m_size = shrunk_border_offset;
@@ -502,12 +503,12 @@
    //Check alignment
    algo_impl_t::check_alignment(addr);
    //Check size
- assert(size >= (BlockCtrlBytes + EndCtrlBlockBytes));
+ BOOST_ASSERT(size >= (BlockCtrlBytes + EndCtrlBlockBytes));
 
    //Initialize the first big block and the "end" node
    block_ctrl *first_big_block = new(addr)block_ctrl;
    first_big_block->m_size = size/Alignment - EndCtrlBlockUnits;
- assert(first_big_block->m_size >= BlockCtrlUnits);
+ BOOST_ASSERT(first_big_block->m_size >= BlockCtrlUnits);
 
    //The "end" node is just a node of size 0 with the "end" bit set
    block_ctrl *end_block = static_cast<block_ctrl*>
@@ -519,20 +520,20 @@
       (reinterpret_cast<char*>(first_big_block) - reinterpret_cast<char*>(end_block))/Alignment;
    priv_mark_as_allocated_block(end_block);
 
- assert(priv_next_block(first_big_block) == end_block);
- assert(priv_next_block(end_block) == first_big_block);
- assert(priv_end_block(first_big_block) == end_block);
- assert(priv_prev_block(end_block) == first_big_block);
+ BOOST_ASSERT(priv_next_block(first_big_block) == end_block);
+ BOOST_ASSERT(priv_next_block(end_block) == first_big_block);
+ BOOST_ASSERT(priv_end_block(first_big_block) == end_block);
+ BOOST_ASSERT(priv_prev_block(end_block) == first_big_block);
 
    //Some check to validate the algorithm, since it makes some assumptions
    //to optimize the space wasted in bookkeeping:
 
    //Check that the sizes of the header are placed before the rbtree
- assert(static_cast<void*>(static_cast<SizeHolder*>(first_big_block))
+ BOOST_ASSERT(static_cast<void*>(static_cast<SizeHolder*>(first_big_block))
           < static_cast<void*>(static_cast<TreeHook*>(first_big_block)));
 
    //Check that the alignment is power of two (we use some optimizations based on this)
- //assert((Alignment % 2) == 0);
+ //BOOST_ASSERT((Alignment % 2) == 0);
    //Insert it in the intrusive containers
    m_header.m_imultiset.insert(*first_big_block);
 }
@@ -656,7 +657,7 @@
                         void *reuse_ptr, std::size_t sizeof_object)
 {
    if(!sizeof_object)
- return std::pair<void *, bool>(static_cast<void*>(0), 0);
+ return std::pair<void *, bool>(static_cast<void*>(0), false);
    if(command & boost::interprocess::try_shrink_in_place){
       bool success = algo_impl_t::try_shrink
          ( this, reuse_ptr, limit_objects*sizeof_object
@@ -712,11 +713,19 @@
    imultiset_iterator ib(m_header.m_imultiset.begin()), ie(m_header.m_imultiset.end());
 
    //Iterate through all blocks obtaining their size
- for(; ib != ie; ++ib){
- //Just clear user the memory part reserved for the user
- std::memset( reinterpret_cast<char*>(&*ib) + BlockCtrlBytes
- , 0
- , ib->m_size*Alignment - BlockCtrlBytes);
+ while(ib != ie){
+ //Just clear user the memory part reserved for the user
+ volatile char *ptr = reinterpret_cast<char*>(&*ib) + BlockCtrlBytes;
+ std::size_t s = ib->m_size*Alignment - BlockCtrlBytes;
+ while(s--){
+ *ptr++ = 0;
+ }
+
+ //This surprisingly is optimized out by Visual C++ 7.1 in release mode!
+ //std::memset( reinterpret_cast<char*>(&*ib) + BlockCtrlBytes
+ // , 0
+ // , ib->m_size*Alignment - BlockCtrlBytes);
+ ++ib;
    }
 }
 
@@ -751,7 +760,7 @@
       block_ctrl *reuse = priv_get_block(reuse_ptr);
 
       //Sanity check
- //assert(reuse->m_size == priv_tail_size(reuse));
+ //BOOST_ASSERT(reuse->m_size == priv_tail_size(reuse));
       algo_impl_t::assert_alignment(reuse);
 
       block_ctrl *prev_block;
@@ -762,10 +771,10 @@
       }
 
       prev_block = priv_prev_block(reuse);
- assert(!priv_is_allocated_block(prev_block));
+ BOOST_ASSERT(!priv_is_allocated_block(prev_block));
 
       //Some sanity checks
- assert(prev_block->m_size == reuse->m_prev_size);
+ BOOST_ASSERT(prev_block->m_size == reuse->m_prev_size);
       algo_impl_t::assert_alignment(prev_block);
 
       std::size_t needs_backwards_aligned;
@@ -784,9 +793,9 @@
          if(command & boost::interprocess::expand_fwd){
             std::size_t received_size2;
             if(!priv_expand(reuse_ptr, received_size, received_size, received_size2)){
- assert(0);
+ BOOST_ASSERT(0);
             }
- assert(received_size = received_size2);
+ BOOST_ASSERT(received_size = received_size2);
          }
          //We need a minimum size to split the previous one
          if(prev_block->m_size >= (needs_backwards_aligned/Alignment + BlockCtrlUnits)){
@@ -796,12 +805,12 @@
             //Free old previous buffer
             new_block->m_size =
                AllocatedCtrlUnits + (needs_backwards_aligned + (received_size - UsableByPreviousChunk))/Alignment;
- assert(new_block->m_size >= BlockCtrlUnits);
+ BOOST_ASSERT(new_block->m_size >= BlockCtrlUnits);
             priv_mark_new_allocated_block(new_block);
 
             prev_block->m_size = (reinterpret_cast<char*>(new_block) -
                                   reinterpret_cast<char*>(prev_block))/Alignment;
- assert(prev_block->m_size >= BlockCtrlUnits);
+ BOOST_ASSERT(prev_block->m_size >= BlockCtrlUnits);
             priv_mark_as_free_block(prev_block);
 
             //Update the old previous block in the free blocks tree
@@ -827,7 +836,7 @@
             //first bytes, fill them with a pattern
             void *p = priv_get_user_buffer(new_block);
             void *user_ptr = reinterpret_cast<char*>(p);
- assert((static_cast<char*>(reuse_ptr) - static_cast<char*>(user_ptr)) % backwards_multiple == 0);
+ BOOST_ASSERT((static_cast<char*>(reuse_ptr) - static_cast<char*>(user_ptr)) % backwards_multiple == 0);
             algo_impl_t::assert_alignment(user_ptr);
             return user_ptr;
          }
@@ -845,13 +854,13 @@
             m_header.m_allocated += prev_block->m_size*Alignment;
             //Now update sizes
             prev_block->m_size = prev_block->m_size + reuse->m_size;
- assert(prev_block->m_size >= BlockCtrlUnits);
+ BOOST_ASSERT(prev_block->m_size >= BlockCtrlUnits);
             priv_mark_new_allocated_block(prev_block);
 
             //If the backwards expansion has remaining bytes in the
             //first bytes, fill them with a pattern
             void *user_ptr = priv_get_user_buffer(prev_block);
- assert((static_cast<char*>(reuse_ptr) - static_cast<char*>(user_ptr)) % backwards_multiple == 0);
+ BOOST_ASSERT((static_cast<char*>(reuse_ptr) - static_cast<char*>(user_ptr)) % backwards_multiple == 0);
             algo_impl_t::assert_alignment(user_ptr);
             return user_ptr;
          }
@@ -977,8 +986,8 @@
    std::size_t old_block_units = block->m_size;
 
    //The block must be marked as allocated and the sizes must be equal
- assert(priv_is_allocated_block(block));
- //assert(old_block_units == priv_tail_size(block));
+ BOOST_ASSERT(priv_is_allocated_block(block));
+ //BOOST_ASSERT(old_block_units == priv_tail_size(block));
    
    //Put this to a safe value
    received_size = (old_block_units - AllocatedCtrlUnits)*Alignment + UsableByPreviousChunk;
@@ -990,7 +999,7 @@
    const std::size_t preferred_user_units = algo_impl_t::ceil_units(preferred_size - UsableByPreviousChunk);
 
    //Some parameter checks
- assert(min_user_units <= preferred_user_units);
+ BOOST_ASSERT(min_user_units <= preferred_user_units);
 
    block_ctrl *next_block;
 
@@ -1022,7 +1031,7 @@
       //This block is bigger than needed, split it in
       //two blocks, the first one will be merged and
       //the second's size will be the remaining space
- assert(next_block->m_size == priv_next_block(next_block)->m_prev_size);
+ BOOST_ASSERT(next_block->m_size == priv_next_block(next_block)->m_prev_size);
       const std::size_t rem_units = merged_units - intended_units;
 
       //Check if we we need to update the old next block in the free blocks tree
@@ -1045,7 +1054,7 @@
                      (reinterpret_cast<char*>(block) + intended_units*Alignment))block_ctrl;
       rem_block->m_size = rem_units;
       algo_impl_t::assert_alignment(rem_block);
- assert(rem_block->m_size >= BlockCtrlUnits);
+ BOOST_ASSERT(rem_block->m_size >= BlockCtrlUnits);
       priv_mark_as_free_block(rem_block);
 
       //Now the second part of the fixup
@@ -1056,7 +1065,7 @@
 
       //Write the new length
       block->m_size = intended_user_units + AllocatedCtrlUnits;
- assert(block->m_size >= BlockCtrlUnits);
+ BOOST_ASSERT(block->m_size >= BlockCtrlUnits);
       m_header.m_allocated += (intended_units - old_block_units)*Alignment;
    }
    //There is no free space to create a new node: just merge both blocks
@@ -1066,7 +1075,7 @@
 
       //Write the new length
       block->m_size = merged_units;
- assert(block->m_size >= BlockCtrlUnits);
+ BOOST_ASSERT(block->m_size >= BlockCtrlUnits);
       m_header.m_allocated += (merged_units - old_block_units)*Alignment;
    }
    priv_mark_as_allocated_block(block);
@@ -1079,7 +1088,7 @@
    rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_prev_block
       (typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *ptr)
 {
- assert(!ptr->m_prev_allocated);
+ BOOST_ASSERT(!ptr->m_prev_allocated);
    return reinterpret_cast<block_ctrl *>
       (reinterpret_cast<char*>(ptr) - ptr->m_prev_size*Alignment);
 }
@@ -1094,7 +1103,7 @@
    else{
       block_ctrl *prev = priv_prev_block(ptr);
       (void)prev;
- assert(!priv_is_allocated_block(prev));
+ BOOST_ASSERT(!priv_is_allocated_block(prev));
       return false;
    }
 }
@@ -1104,12 +1113,12 @@
    rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_end_block
       (typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *first_segment_block)
 {
- assert(first_segment_block->m_prev_allocated);
+ BOOST_ASSERT(first_segment_block->m_prev_allocated);
    block_ctrl *end_block = reinterpret_cast<block_ctrl *>
       (reinterpret_cast<char*>(first_segment_block) - first_segment_block->m_prev_size*Alignment);
    (void)end_block;
- assert(priv_is_allocated_block(end_block));
- assert(end_block > first_segment_block);
+ BOOST_ASSERT(priv_is_allocated_block(end_block));
+ BOOST_ASSERT(end_block > first_segment_block);
    return end_block;
 }
 
@@ -1131,7 +1140,7 @@
       (reinterpret_cast<char*>(block) + block->m_size*Alignment);
    bool next_block_prev_allocated = next_block->m_prev_allocated != 0;
    (void)next_block_prev_allocated;
- assert(allocated == next_block_prev_allocated);
+ BOOST_ASSERT(allocated == next_block_prev_allocated);
    return allocated;
 }
 
@@ -1139,7 +1148,7 @@
 void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_mark_as_allocated_block
       (typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *block)
 {
- //assert(!priv_is_allocated_block(block));
+ //BOOST_ASSERT(!priv_is_allocated_block(block));
    block->m_allocated = 1;
    reinterpret_cast<block_ctrl *>
       (reinterpret_cast<char*>(block)+ block->m_size*Alignment)->m_prev_allocated = 1;
@@ -1152,7 +1161,7 @@
    block->m_allocated = 0;
    reinterpret_cast<block_ctrl *>
       (reinterpret_cast<char*>(block) + block->m_size*Alignment)->m_prev_allocated = 0;
- //assert(!priv_is_allocated_block(ptr));
+ //BOOST_ASSERT(!priv_is_allocated_block(ptr));
    priv_next_block(block)->m_prev_size = block->m_size;
 }
 
@@ -1172,14 +1181,14 @@
       //the second's size "block->m_size-units"
       std::size_t block_old_size = block->m_size;
       block->m_size = nunits;
- assert(block->m_size >= BlockCtrlUnits);
+ BOOST_ASSERT(block->m_size >= BlockCtrlUnits);
 
       //This is the remaining block
       block_ctrl *rem_block = new(reinterpret_cast<block_ctrl*>
                      (reinterpret_cast<char*>(block) + Alignment*nunits))block_ctrl;
       algo_impl_t::assert_alignment(rem_block);
       rem_block->m_size = block_old_size - nunits;
- assert(rem_block->m_size >= BlockCtrlUnits);
+ BOOST_ASSERT(rem_block->m_size >= BlockCtrlUnits);
       priv_mark_as_free_block(rem_block);
 
       imultiset_iterator it_hint;
@@ -1204,7 +1213,7 @@
       m_header.m_imultiset.erase(it_old);
    }
    else{
- assert(0);
+ BOOST_ASSERT(0);
       return 0;
    }
    //We need block_ctrl for deallocation stuff, so
@@ -1218,7 +1227,16 @@
    //Clear the memory occupied by the tree hook, since this won't be
    //cleared with zero_free_memory
    TreeHook *t = static_cast<TreeHook*>(block);
- std::memset(t, 0, sizeof(*t));
+ //Just clear the memory part reserved for the user
+ std::size_t tree_hook_offset_in_block = (char*)t - (char*)block;
+ //volatile char *ptr =
+ char *ptr = reinterpret_cast<char*>(block)+tree_hook_offset_in_block;
+ const std::size_t s = BlockCtrlBytes - tree_hook_offset_in_block;
+ /*
+ while(s--){
+ *ptr++ = 0;
+ }*/
+ std::memset(ptr, 0, s);
    this->priv_next_block(block)->m_prev_size = 0;
    return priv_get_user_buffer(block);
 }
@@ -1241,14 +1259,14 @@
    block_ctrl *block = priv_get_block(addr);
   
    //The blocks must be marked as allocated and the sizes must be equal
- assert(priv_is_allocated_block(block));
-// assert(block->m_size == priv_tail_size(block));
+ BOOST_ASSERT(priv_is_allocated_block(block));
+// BOOST_ASSERT(block->m_size == priv_tail_size(block));
 
    //Check if alignment and block size are right
    algo_impl_t::assert_alignment(addr);
 
    std::size_t block_old_size = Alignment*block->m_size;
- assert(m_header.m_allocated >= block_old_size);
+ BOOST_ASSERT(m_header.m_allocated >= block_old_size);
 
    //Update used memory count
    m_header.m_allocated -= block_old_size;
@@ -1268,13 +1286,13 @@
          //Get the previous block
          block_ctrl *prev_block = priv_prev_block(block);
          prev_block->m_size += block->m_size;
- assert(prev_block->m_size >= BlockCtrlUnits);
+ BOOST_ASSERT(prev_block->m_size >= BlockCtrlUnits);
          block_to_insert = prev_block;
       }
       //Merge if the next is free
       if(merge_with_next){
          block_to_insert->m_size += next_block->m_size;
- assert(block_to_insert->m_size >= BlockCtrlUnits);
+ BOOST_ASSERT(block_to_insert->m_size >= BlockCtrlUnits);
          if(merge_with_prev)
             m_header.m_imultiset.erase(Imultiset::s_iterator_to(*next_block));
       }

Modified: branches/release/boost/interprocess/offset_ptr.hpp
==============================================================================
--- branches/release/boost/interprocess/offset_ptr.hpp (original)
+++ branches/release/boost/interprocess/offset_ptr.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -22,6 +22,8 @@
 #include <boost/interprocess/detail/utilities.hpp>
 #include <boost/interprocess/detail/cast_tags.hpp>
 #include <boost/interprocess/detail/mpl.hpp>
+#include <boost/pointer_cast.hpp>
+#include <boost/assert.hpp>
 #include <boost/assert.hpp>
 #include <ostream>
 #include <istream>
@@ -58,21 +60,17 @@
    typedef void (self_t::*unspecified_bool_type)() const;
 
    #if defined(_MSC_VER) && (_MSC_VER >= 1400)
- __declspec(noinline) //this workaround is needed for msvc-8.0 and msvc-9.0
+ __declspec(noinline) //this workaround is needed for msvc > 8.0
    #endif
- void set_offset(const volatile void *ptr)
- { set_offset(const_cast<const void*>(ptr)); }
-
- void set_offset(const void *ptr)
+ void set_offset(const PointedType *ptr)
    {
- const char *p = static_cast<const char*>(ptr);
       //offset == 1 && ptr != 0 is not legal for this pointer
       if(!ptr){
- m_offset = 1;
+ internal.m_offset = 1;
       }
       else{
- m_offset = p - reinterpret_cast<const char*>(this);
- BOOST_ASSERT(m_offset != 1);
+ internal.m_offset = (const char*)ptr - (const char*)(this);
+ BOOST_ASSERT(internal.m_offset != 1);
       }
    }
 
@@ -80,15 +78,18 @@
    __declspec(noinline) //this workaround is needed for msvc-8.0 and msvc-9.0
    #endif
    void* get_pointer() const
- { return (m_offset == 1) ? 0 : (const_cast<char*>(reinterpret_cast<const char*>(this)) + m_offset); }
+ { return (internal.m_offset == 1) ? 0 : (const_cast<char*>(reinterpret_cast<const char*>(this)) + internal.m_offset); }
 
    void inc_offset(std::ptrdiff_t bytes)
- { m_offset += bytes; }
+ { internal.m_offset += bytes; }
 
    void dec_offset(std::ptrdiff_t bytes)
- { m_offset -= bytes; }
+ { internal.m_offset -= bytes; }
 
- std::ptrdiff_t m_offset; //Distance between this object and pointed address
+ union internal_type{
+ std::ptrdiff_t m_offset; //Distance between this object and pointed address
+ PointedType *aliasing_helper;
+ } internal;
    /// @endcond
 
    public:
@@ -151,8 +152,8 @@
    pointer get()const
    { return static_cast<pointer>(this->get_pointer()); }
 
- std::ptrdiff_t get_offset()
- { return m_offset; }
+ std::ptrdiff_t get_offset() const
+ { return internal.m_offset; }
 
    //!Pointer-like -> operator. It can return 0 pointer.
    //!Never throws.
@@ -330,7 +331,7 @@
 //!Simulation of static_cast between pointers. Never throws.
 template<class T, class U>
 inline boost::interprocess::offset_ptr<T>
- static_pointer_cast(boost::interprocess::offset_ptr<U> const & r)
+ static_pointer_cast(const boost::interprocess::offset_ptr<U> & r)
 {
    return boost::interprocess::offset_ptr<T>
             (r, boost::interprocess::detail::static_cast_tag());
@@ -339,7 +340,7 @@
 //!Simulation of const_cast between pointers. Never throws.
 template<class T, class U>
 inline boost::interprocess::offset_ptr<T>
- const_pointer_cast(boost::interprocess::offset_ptr<U> const & r)
+ const_pointer_cast(const boost::interprocess::offset_ptr<U> & r)
 {
    return boost::interprocess::offset_ptr<T>
             (r, boost::interprocess::detail::const_cast_tag());
@@ -348,7 +349,7 @@
 //!Simulation of dynamic_cast between pointers. Never throws.
 template<class T, class U>
 inline boost::interprocess::offset_ptr<T>
- dynamic_pointer_cast(boost::interprocess::offset_ptr<U> const & r)
+ dynamic_pointer_cast(const boost::interprocess::offset_ptr<U> & r)
 {
    return boost::interprocess::offset_ptr<T>
             (r, boost::interprocess::detail::dynamic_cast_tag());
@@ -357,7 +358,7 @@
 //!Simulation of reinterpret_cast between pointers. Never throws.
 template<class T, class U>
 inline boost::interprocess::offset_ptr<T>
- reinterpret_pointer_cast(boost::interprocess::offset_ptr<U> const & r)
+ reinterpret_pointer_cast(const boost::interprocess::offset_ptr<U> & r)
 {
    return boost::interprocess::offset_ptr<T>
             (r, boost::interprocess::detail::reinterpret_cast_tag());
@@ -434,7 +435,7 @@
    static void set_pointer(pointer &n, pointer p)
    {
       std::size_t pint = std::size_t(p.get());
- assert(0 == (std::size_t(pint) & Mask));
+ BOOST_ASSERT(0 == (std::size_t(pint) & Mask));
       n = reinterpret_cast<T*>(pint | (std::size_t(n.get()) & std::size_t(Mask)));
    }
 
@@ -443,7 +444,7 @@
 
    static void set_bits(pointer &n, std::size_t b)
    {
- assert(b < (std::size_t(1) << NumBits));
+ BOOST_ASSERT(b < (std::size_t(1) << NumBits));
       n = reinterpret_cast<T*>(std::size_t(get_pointer(n).get()) | (b << 1u));
    }
 };

Modified: branches/release/boost/interprocess/segment_manager.hpp
==============================================================================
--- branches/release/boost/interprocess/segment_manager.hpp (original)
+++ branches/release/boost/interprocess/segment_manager.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -38,6 +38,7 @@
 #include <string> //char_traits
 #include <new> //std::nothrow
 #include <utility> //std::pair
+#include <boost/assert.hpp>
 #ifndef BOOST_NO_EXCEPTIONS
 #include <exception>
 #endif
@@ -94,7 +95,7 @@
    segment_manager_base(std::size_t size, std::size_t reserved_bytes)
       : MemoryAlgorithm(size, reserved_bytes)
    {
- assert((sizeof(segment_manager_base<MemoryAlgorithm>) == sizeof(MemoryAlgorithm)));
+ BOOST_ASSERT((sizeof(segment_manager_base<MemoryAlgorithm>) == sizeof(MemoryAlgorithm)));
    }
 
    //!Returns the size of the memory
@@ -300,7 +301,7 @@
 
       if(ctrl_data->alloc_type() != anonymous_type){
          //This is not an anonymous object, the pointer is wrong!
- assert(0);
+ BOOST_ASSERT(0);
       }
 
       //Call destructors and free memory
@@ -407,7 +408,7 @@
       , m_header(static_cast<Base*>(get_this_pointer()))
    {
       (void) anonymous_instance; (void) unique_instance;
- assert(static_cast<const void*>(this) == static_cast<const void*>(static_cast<Base*>(this)));
+ BOOST_ASSERT(static_cast<const void*>(this) == static_cast<const void*>(static_cast<Base*>(this)));
    }
 
    //!Tries to find a previous named allocation. Returns the address
@@ -499,6 +500,24 @@
    void atomic_func(Func &f)
    { scoped_lock<rmutex> guard(m_header); f(); }
 
+ //!Tries to calls a functor guaranteeing that no new construction, search or
+ //!destruction will be executed by any process while executing the object
+ //!function call. If the atomic function can't be immediatelly executed
+ //!because the internal mutex is already locked, returns false.
+ //!If the functor throws, this function throws.
+ template <class Func>
+ bool try_atomic_func(Func &f)
+ {
+ scoped_lock<rmutex> guard(m_header, try_to_lock);
+ if(guard){
+ f();
+ return true;
+ }
+ else{
+ return false;
+ }
+ }
+
    //!Destroys a previously created unique instance.
    //!Returns false if the object was not present.
    template <class T>
@@ -692,7 +711,7 @@
    std::pair<T*, std::size_t> priv_find_impl (const CharType* name, bool lock)
    {
       //The name can't be null, no anonymous object can be found by name
- assert(name != 0);
+ BOOST_ASSERT(name != 0);
       detail::placement_destroy<T> table;
       std::size_t size;
       void *ret;
@@ -766,7 +785,7 @@
 
          default:
             //This type is unknown, bad pointer passed to this function!
- assert(0);
+ BOOST_ASSERT(0);
          break;
       }
    }
@@ -777,22 +796,22 @@
    {
       boost::interprocess::allocation_type type = ctrl_data->alloc_type();
       if(type != named_type){
- assert((type == anonymous_type && ctrl_data->m_num_char == 0) ||
+ BOOST_ASSERT((type == anonymous_type && ctrl_data->m_num_char == 0) ||
                 (type == unique_type && ctrl_data->m_num_char != 0) );
          return 0;
       }
       CharType *name = static_cast<CharType*>(ctrl_data->template name<CharType>());
    
       //Sanity checks
- assert(ctrl_data->sizeof_char() == sizeof(CharType));
- assert(ctrl_data->m_num_char == std::char_traits<CharType>::length(name));
+ BOOST_ASSERT(ctrl_data->sizeof_char() == sizeof(CharType));
+ BOOST_ASSERT(ctrl_data->m_num_char == std::char_traits<CharType>::length(name));
       return name;
    }
 
    static std::size_t priv_get_instance_length(block_header_t *ctrl_data, std::size_t sizeofvalue)
    {
       //Get header
- assert((ctrl_data->value_bytes() %sizeofvalue) == 0);
+ BOOST_ASSERT((ctrl_data->value_bytes() %sizeofvalue) == 0);
       return ctrl_data->value_bytes()/sizeofvalue;
    }
 
@@ -801,7 +820,7 @@
    static instance_type priv_get_instance_type(block_header_t *ctrl_data)
    {
       //Get header
- assert((instance_type)ctrl_data->alloc_type() < max_allocation_type);
+ BOOST_ASSERT((instance_type)ctrl_data->alloc_type() < max_allocation_type);
       return (instance_type)ctrl_data->alloc_type();
    }
 
@@ -844,8 +863,8 @@
          block_header_t *ctrl_data = it->get_block_header();
 
          //Sanity check
- assert((ctrl_data->m_value_bytes % table.size) == 0);
- assert(ctrl_data->sizeof_char() == sizeof(CharT));
+ BOOST_ASSERT((ctrl_data->m_value_bytes % table.size) == 0);
+ BOOST_ASSERT(ctrl_data->sizeof_char() == sizeof(CharT));
          ret_ptr = ctrl_data->value();
          length = ctrl_data->m_value_bytes/table.size;
       }
@@ -883,8 +902,8 @@
                                     (detail::get_pointer(it->second.m_ptr));
 
          //Sanity check
- assert((ctrl_data->m_value_bytes % table.size) == 0);
- assert(ctrl_data->sizeof_char() == sizeof(CharT));
+ BOOST_ASSERT((ctrl_data->m_value_bytes % table.size) == 0);
+ BOOST_ASSERT(ctrl_data->sizeof_char() == sizeof(CharT));
          ret_ptr = ctrl_data->value();
          length = ctrl_data->m_value_bytes/table.size;
       }
@@ -940,7 +959,7 @@
       //If not found, return false
       if(it == index.end()){
          //This name is not present in the index, wrong pointer or name!
- //assert(0);
+ //BOOST_ASSERT(0);
          return false;
       }
 
@@ -951,8 +970,8 @@
       std::size_t num = ctrl_data->m_value_bytes/table.size;
       
       //Sanity check
- assert((ctrl_data->m_value_bytes % table.size) == 0);
- assert(sizeof(CharT) == ctrl_data->sizeof_char());
+ BOOST_ASSERT((ctrl_data->m_value_bytes % table.size) == 0);
+ BOOST_ASSERT(sizeof(CharT) == ctrl_data->sizeof_char());
 
       //Erase node from index
       index.erase(it);
@@ -989,7 +1008,7 @@
       //If not found, return false
       if(it == index.end()){
          //This name is not present in the index, wrong pointer or name!
- //assert(0);
+ //BOOST_ASSERT(0);
          return false;
       }
       return this->priv_generic_named_destroy_impl<CharT>(it, index, table);
@@ -1016,9 +1035,9 @@
       void *values = ctrl_data->value();
 
       //Sanity check
- assert((ctrl_data->m_value_bytes % table.size) == 0);
- assert(static_cast<void*>(stored_name) == static_cast<void*>(ctrl_data->template name<CharT>()));
- assert(sizeof(CharT) == ctrl_data->sizeof_char());
+ BOOST_ASSERT((ctrl_data->m_value_bytes % table.size) == 0);
+ BOOST_ASSERT(static_cast<void*>(stored_name) == static_cast<void*>(ctrl_data->template name<CharT>()));
+ BOOST_ASSERT(sizeof(CharT) == ctrl_data->sizeof_char());
 
       //Erase node from index
       index.erase(it);

Modified: branches/release/boost/interprocess/shared_memory_object.hpp
==============================================================================
--- branches/release/boost/interprocess/shared_memory_object.hpp (original)
+++ branches/release/boost/interprocess/shared_memory_object.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -20,6 +20,7 @@
 #include <boost/interprocess/exceptions.hpp>
 #include <boost/interprocess/detail/os_file_functions.hpp>
 #include <boost/interprocess/detail/tmp_dir_helpers.hpp>
+#include <boost/interprocess/permissions.hpp>
 #include <cstddef>
 #include <string>
 #include <algorithm>
@@ -56,19 +57,19 @@
 
    //!Creates a shared memory object with name "name" and mode "mode", with the access mode "mode"
    //!If the file previously exists, throws an error.*/
- shared_memory_object(create_only_t, const char *name, mode_t mode)
- { this->priv_open_or_create(detail::DoCreate, name, mode); }
+ shared_memory_object(create_only_t, const char *name, mode_t mode, const permissions &perm = permissions())
+ { this->priv_open_or_create(detail::DoCreate, name, mode, perm); }
 
    //!Tries to create a shared memory object with name "name" and mode "mode", with the
    //!access mode "mode". If the file previously exists, it tries to open it with mode "mode".
    //!Otherwise throws an error.
- shared_memory_object(open_or_create_t, const char *name, mode_t mode)
- { this->priv_open_or_create(detail::DoOpenOrCreate, name, mode); }
+ shared_memory_object(open_or_create_t, const char *name, mode_t mode, const permissions &perm = permissions())
+ { this->priv_open_or_create(detail::DoOpenOrCreate, name, mode, perm); }
 
    //!Tries to open a shared memory object with name "name", with the access mode "mode".
    //!If the file does not previously exist, it throws an error.
    shared_memory_object(open_only_t, const char *name, mode_t mode)
- { this->priv_open_or_create(detail::DoOpen, name, mode); }
+ { this->priv_open_or_create(detail::DoOpen, name, mode, permissions()); }
 
    //!Moves the ownership of "moved"'s shared memory object to *this.
    //!After the call, "moved" does not represent any shared memory object.
@@ -126,7 +127,7 @@
    void priv_close();
 
    //!Closes a previously opened file mapping. Never throws.
- bool priv_open_or_create(detail::create_enum_t type, const char *filename, mode_t mode);
+ bool priv_open_or_create(detail::create_enum_t type, const char *filename, mode_t mode, const permissions &perm);
 
    file_handle_t m_handle;
    mode_t m_mode;
@@ -168,11 +169,11 @@
 #if !defined(BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS)
 
 inline bool shared_memory_object::priv_open_or_create
- (detail::create_enum_t type, const char *filename, mode_t mode)
+ (detail::create_enum_t type, const char *filename, mode_t mode, const permissions &perm)
 {
    m_filename = filename;
    std::string shmfile;
- detail::create_tmp_dir_and_get_filename(filename, shmfile);
+ detail::create_tmp_and_clean_old_and_get_filename(filename, shmfile);
 
    //Set accesses
    if (mode != read_write && mode != read_only){
@@ -185,10 +186,10 @@
          m_handle = detail::open_existing_file(shmfile.c_str(), mode, true);
       break;
       case detail::DoCreate:
- m_handle = detail::create_new_file(shmfile.c_str(), mode, true);
+ m_handle = detail::create_new_file(shmfile.c_str(), mode, perm, true);
       break;
       case detail::DoOpenOrCreate:
- m_handle = detail::create_or_open_file(shmfile.c_str(), mode, true);
+ m_handle = detail::create_or_open_file(shmfile.c_str(), mode, perm, true);
       break;
       default:
          {
@@ -214,7 +215,7 @@
       //Make sure a temporary path is created for shared memory
       std::string shmfile;
       detail::tmp_filename(filename, shmfile);
- return detail::delete_file(shmfile.c_str()) == 0;
+ return detail::delete_file(shmfile.c_str());
    }
    catch(...){
       return false;
@@ -242,12 +243,12 @@
 inline bool shared_memory_object::priv_open_or_create
    (detail::create_enum_t type,
     const char *filename,
- mode_t mode)
+ mode_t mode, const permissions &perm)
 {
    #ifndef BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SHARED_MEMORY
    detail::add_leading_slash(filename, m_filename);
    #else
- detail::create_tmp_dir_and_get_filename(filename, m_filename);
+ detail::create_tmp_and_clean_old_and_get_filename(filename, m_filename);
    #endif
 
    //Create new mapping
@@ -281,7 +282,11 @@
    }
 
    //Open file using POSIX API
- m_handle = shm_open(m_filename.c_str(), oflag, S_IRWXO | S_IRWXG | S_IRWXU);
+ m_handle = shm_open(m_filename.c_str(), oflag, perm.get_permissions());
+
+ if(m_handle >= 0){
+ ::fchmod(m_handle, perm.get_permissions());
+ }
 
    //Check for error
    if(m_handle == -1){

Modified: branches/release/boost/interprocess/smart_ptr/shared_ptr.hpp
==============================================================================
--- branches/release/boost/interprocess/smart_ptr/shared_ptr.hpp (original)
+++ branches/release/boost/interprocess/smart_ptr/shared_ptr.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -108,7 +108,7 @@
    typedef typename boost::pointer_to_other
             <typename VoidAllocator::pointer, const VoidAllocator>::type const_allocator_pointer;
 
- BOOST_COPYABLE_AND_MOVABLE(shared_ptr)
+ BOOST_INTERPROCESS_COPYABLE_AND_MOVABLE(shared_ptr)
    public:
 
    //!Constructs an empty shared_ptr.

Modified: branches/release/boost/interprocess/streams/bufferstream.hpp
==============================================================================
--- branches/release/boost/interprocess/streams/bufferstream.hpp (original)
+++ branches/release/boost/interprocess/streams/bufferstream.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -44,7 +44,7 @@
 #include <ostream>
 #include <string> // char traits
 #include <cstddef> // ptrdiff_t
-#include <cassert>
+#include <boost/assert.hpp>
 #include <boost/interprocess/interprocess_fwd.hpp>
 
 namespace boost { namespace interprocess {

Modified: branches/release/boost/interprocess/streams/vectorstream.hpp
==============================================================================
--- branches/release/boost/interprocess/streams/vectorstream.hpp (original)
+++ branches/release/boost/interprocess/streams/vectorstream.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -46,7 +46,7 @@
 #include <string> // char traits
 #include <cstddef> // ptrdiff_t
 #include <boost/interprocess/interprocess_fwd.hpp>
-#include <cassert>
+#include <boost/assert.hpp>
 
 namespace boost { namespace interprocess {
 
@@ -186,7 +186,7 @@
          int real_size = (int)m_vect.size();
          //Then maximize size for high watermarking
          m_vect.resize(m_vect.capacity());
- assert(m_vect.size() == m_vect.capacity());
+ BOOST_ASSERT(m_vect.size() == m_vect.capacity());
          //Set high watermarking with the expanded size
          mp_high_water = m_vect.size() ? (&m_vect[0] + real_size) : 0;
          //Now set formatting pointers
@@ -263,7 +263,7 @@
                //Insert the new data
                m_vect.push_back(CharTraits::to_char_type(c));
                m_vect.resize(m_vect.capacity());
- assert(m_vect.size() == m_vect.capacity());
+ BOOST_ASSERT(m_vect.size() == m_vect.capacity());
                char_type* p = const_cast<char_type*>(&m_vect[0]);
                //A reallocation might have happened, update pointers
                base_t::setp(p, p + (dif_t)m_vect.size());

Modified: branches/release/boost/interprocess/sync/emulation/interprocess_condition.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/emulation/interprocess_condition.hpp (original)
+++ branches/release/boost/interprocess/sync/emulation/interprocess_condition.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -155,28 +155,6 @@
          break;
       }
       else{
- //Notification occurred, we will lock the checking interprocess_mutex so that
- //if a notify_one notification occurs, only one thread can exit
- //---------------------------------------------------------------
- /*
- InternalLock lock;
- if(tout_enabled){
- InternalLock dummy(m_check_mut, abs_time);
- lock = boost::interprocess::move(dummy);
- }
- else{
- InternalLock dummy(m_check_mut);
- lock = boost::interprocess::move(dummy);
- }
- if(!lock){
- timed_out = true;
- unlock_enter_mut = true;
- detail::atomic_dec32(const_cast<boost::uint32_t*>(&m_num_waiters));
- break;
- }
- //---------------------------------------------------------------
- */
- //InternalLock lock(m_check_mut);
          boost::uint32_t result = detail::atomic_cas32
                         (const_cast<boost::uint32_t*>(&m_command), SLEEP, NOTIFY_ONE);
          if(result == SLEEP){

Deleted: branches/release/boost/interprocess/sync/emulation/interprocess_mutex.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/emulation/interprocess_mutex.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
+++ (empty file)
@@ -1,81 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
-// Software License, Version 1.0. (See accompanying file
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/interprocess for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
-
-namespace boost {
-
-namespace interprocess {
-
-inline interprocess_mutex::interprocess_mutex()
- : m_s(0)
-{
- //Note that this class is initialized to zero.
- //So zeroed memory can be interpreted as an
- //initialized mutex
-}
-
-inline interprocess_mutex::~interprocess_mutex()
-{
- //Trivial destructor
-}
-
-inline void interprocess_mutex::lock(void)
-{
- do{
- boost::uint32_t prev_s = detail::atomic_cas32(const_cast<boost::uint32_t*>(&m_s), 1, 0);
-
- if (m_s == 1 && prev_s == 0){
- break;
- }
- // relinquish current timeslice
- detail::thread_yield();
- }while (true);
-}
-
-inline bool interprocess_mutex::try_lock(void)
-{
- boost::uint32_t prev_s = detail::atomic_cas32(const_cast<boost::uint32_t*>(&m_s), 1, 0);
- return m_s == 1 && prev_s == 0;
-}
-
-inline bool interprocess_mutex::timed_lock(const boost::posix_time::ptime &abs_time)
-{
- if(abs_time == boost::posix_time::pos_infin){
- this->lock();
- return true;
- }
- //Obtain current count and target time
- boost::posix_time::ptime now = microsec_clock::universal_time();
-
- if(now >= abs_time) return false;
-
- do{
- if(this->try_lock()){
- break;
- }
- now = microsec_clock::universal_time();
-
- if(now >= abs_time){
- return false;
- }
- // relinquish current time slice
- detail::thread_yield();
- }while (true);
-
- return true;
-}
-
-inline void interprocess_mutex::unlock(void)
-{ detail::atomic_cas32(const_cast<boost::uint32_t*>(&m_s), 0, 1); }
-
-} //namespace interprocess {
-
-} //namespace boost {

Deleted: branches/release/boost/interprocess/sync/emulation/interprocess_recursive_mutex.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/emulation/interprocess_recursive_mutex.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
+++ (empty file)
@@ -1,128 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
-// Software License, Version 1.0. (See accompanying file
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/interprocess for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-//
-// Parts of the pthread code come from Boost Threads code:
-//
-//////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) 2001-2003
-// William E. Kempf
-//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appear in all copies and
-// that both that copyright notice and this permission notice appear
-// in supporting documentation. William E. Kempf makes no representations
-// about the suitability of this software for any purpose.
-// It is provided "as is" without express or implied warranty.
-//////////////////////////////////////////////////////////////////////////////
-
-#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
-#include <boost/interprocess/detail/os_thread_functions.hpp>
-#include <boost/interprocess/exceptions.hpp>
-
-namespace boost {
-
-namespace interprocess {
-
-inline interprocess_recursive_mutex::interprocess_recursive_mutex()
- : m_nLockCount(0), m_nOwner(detail::get_invalid_systemwide_thread_id()){}
-
-inline interprocess_recursive_mutex::~interprocess_recursive_mutex(){}
-
-inline void interprocess_recursive_mutex::lock()
-{
- typedef detail::OS_systemwide_thread_id_t handle_t;
- const handle_t thr_id(detail::get_current_systemwide_thread_id());
- handle_t old_id;
- detail::systemwide_thread_id_copy(m_nOwner, old_id);
- if(detail::equal_systemwide_thread_id(thr_id , old_id)){
- if((unsigned int)(m_nLockCount+1) == 0){
- //Overflow, throw an exception
- throw interprocess_exception();
- }
- ++m_nLockCount;
- }
- else{
- m_mutex.lock();
- detail::systemwide_thread_id_copy(thr_id, m_nOwner);
- m_nLockCount = 1;
- }
-}
-
-inline bool interprocess_recursive_mutex::try_lock()
-{
- typedef detail::OS_systemwide_thread_id_t handle_t;
- handle_t thr_id(detail::get_current_systemwide_thread_id());
- handle_t old_id;
- detail::systemwide_thread_id_copy(m_nOwner, old_id);
- if(detail::equal_systemwide_thread_id(thr_id , old_id)) { // we own it
- if((unsigned int)(m_nLockCount+1) == 0){
- //Overflow, throw an exception
- throw interprocess_exception();
- }
- ++m_nLockCount;
- return true;
- }
- if(m_mutex.try_lock()){
- detail::systemwide_thread_id_copy(thr_id, m_nOwner);
- m_nLockCount = 1;
- return true;
- }
- return false;
-}
-
-inline bool interprocess_recursive_mutex::timed_lock(const boost::posix_time::ptime &abs_time)
-{
- typedef detail::OS_systemwide_thread_id_t handle_t;
- if(abs_time == boost::posix_time::pos_infin){
- this->lock();
- return true;
- }
- const handle_t thr_id(detail::get_current_systemwide_thread_id());
- handle_t old_id;
- detail::systemwide_thread_id_copy(m_nOwner, old_id);
- if(detail::equal_systemwide_thread_id(thr_id , old_id)) { // we own it
- if((unsigned int)(m_nLockCount+1) == 0){
- //Overflow, throw an exception
- throw interprocess_exception();
- }
- ++m_nLockCount;
- return true;
- }
- if(m_mutex.timed_lock(abs_time)){
- detail::systemwide_thread_id_copy(thr_id, m_nOwner);
- m_nLockCount = 1;
- return true;
- }
- return false;
-}
-
-inline void interprocess_recursive_mutex::unlock()
-{
- typedef detail::OS_systemwide_thread_id_t handle_t;
- handle_t old_id;
- detail::systemwide_thread_id_copy(m_nOwner, old_id);
- const handle_t thr_id(detail::get_current_systemwide_thread_id());
- (void)old_id;
- (void)thr_id;
- assert(detail::equal_systemwide_thread_id(thr_id, old_id));
- --m_nLockCount;
- if(!m_nLockCount){
- const handle_t new_id(detail::get_invalid_systemwide_thread_id());
- detail::systemwide_thread_id_copy(new_id, m_nOwner);
- m_mutex.unlock();
- }
-}
-
-} //namespace interprocess {
-
-} //namespace boost {
-

Modified: branches/release/boost/interprocess/sync/file_lock.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/file_lock.hpp (original)
+++ branches/release/boost/interprocess/sync/file_lock.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -201,7 +201,7 @@
 
 inline file_lock::file_lock(const char *name)
 {
- m_file_hnd = detail::open_existing_file(name);
+ m_file_hnd = detail::open_existing_file(name, read_write);
 
    if(m_file_hnd == detail::invalid_file()){
       error_info err(system_error_code());

Modified: branches/release/boost/interprocess/sync/interprocess_condition.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/interprocess_condition.hpp (original)
+++ branches/release/boost/interprocess/sync/interprocess_condition.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -26,7 +26,7 @@
 #include <boost/interprocess/sync/interprocess_mutex.hpp>
 #include <boost/interprocess/exceptions.hpp>
 #include <boost/limits.hpp>
-#include <cassert>
+#include <boost/assert.hpp>
 
 #if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined(BOOST_INTERPROCESS_POSIX_PROCESS_SHARED)
    #include <pthread.h>
@@ -148,8 +148,8 @@
 
    #if defined (BOOST_INTERPROCESS_USE_GENERIC_EMULATION)
       enum { SLEEP = 0, NOTIFY_ONE, NOTIFY_ALL };
- interprocess_mutex m_enter_mut;
- //interprocess_mutex m_check_mut;
+ interprocess_mutex m_enter_mut;
+ //interprocess_mutex m_check_mut;
       volatile boost::uint32_t m_command;
       volatile boost::uint32_t m_num_waiters;
       bool do_timed_wait(bool tout_enabled, const boost::posix_time::ptime &abs_time, interprocess_mutex &mut);

Modified: branches/release/boost/interprocess/sync/interprocess_mutex.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/interprocess_mutex.hpp (original)
+++ branches/release/boost/interprocess/sync/interprocess_mutex.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -11,18 +11,6 @@
 // Parts of the pthread code come from Boost Threads code.
 //
 //////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) 2001-2003
-// William E. Kempf
-//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appear in all copies and
-// that both that copyright notice and this permission notice appear
-// in supporting documentation. William E. Kempf makes no representations
-// about the suitability of this software for any purpose.
-// It is provided "as is" without express or implied warranty.
-//////////////////////////////////////////////////////////////////////////////
 
 #ifndef BOOST_INTERPROCESS_MUTEX_HPP
 #define BOOST_INTERPROCESS_MUTEX_HPP
@@ -36,7 +24,7 @@
 #include <boost/interprocess/detail/config_begin.hpp>
 #include <boost/interprocess/detail/workaround.hpp>
 #include <boost/interprocess/detail/posix_time_types_wrk.hpp>
-#include <cassert>
+#include <boost/assert.hpp>
 
 #if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_POSIX_PROCESS_SHARED)
    #include <pthread.h>
@@ -44,10 +32,19 @@
    #include <boost/interprocess/sync/posix/pthread_helpers.hpp>
    #define BOOST_INTERPROCESS_USE_POSIX
 #else
- #include <boost/interprocess/detail/atomic.hpp>
- #include <boost/cstdint.hpp>
- #include <boost/interprocess/detail/os_thread_functions.hpp>
+ #include <boost/interprocess/sync/emulation/mutex.hpp>
    #define BOOST_INTERPROCESS_USE_GENERIC_EMULATION
+
+namespace boost {
+namespace interprocess {
+namespace detail{
+namespace robust_emulation_helpers {
+
+template<class T>
+class mutex_traits;
+
+}}}}
+
 #endif
 
 /// @endcond
@@ -111,7 +108,9 @@
    private:
 
    #if defined(BOOST_INTERPROCESS_USE_GENERIC_EMULATION)
- volatile boost::uint32_t m_s;
+ friend class detail::robust_emulation_helpers::mutex_traits<interprocess_mutex>;
+ void take_ownership(){ mutex.take_ownership(); }
+ detail::emulation_mutex mutex;
    #elif defined(BOOST_INTERPROCESS_USE_POSIX)
       pthread_mutex_t m_mut;
    #endif //#if (defined BOOST_INTERPROCESS_WINDOWS)
@@ -119,17 +118,29 @@
 };
 
 } //namespace interprocess {
-
 } //namespace boost {
 
 #ifdef BOOST_INTERPROCESS_USE_GENERIC_EMULATION
 # undef BOOST_INTERPROCESS_USE_GENERIC_EMULATION
-# include <boost/interprocess/sync/emulation/interprocess_mutex.hpp>
+
+namespace boost {
+namespace interprocess {
+
+inline interprocess_mutex::interprocess_mutex(){}
+inline interprocess_mutex::~interprocess_mutex(){}
+inline void interprocess_mutex::lock(){ mutex.lock(); }
+inline bool interprocess_mutex::try_lock(){ return mutex.try_lock(); }
+inline bool interprocess_mutex::timed_lock(const boost::posix_time::ptime &abs_time){ return mutex.timed_lock(abs_time); }
+inline void interprocess_mutex::unlock(){ mutex.unlock(); }
+
+} //namespace interprocess {
+} //namespace boost {
+
 #endif
 
 #ifdef BOOST_INTERPROCESS_USE_POSIX
+#include <boost/interprocess/sync/posix/interprocess_mutex.hpp>
 # undef BOOST_INTERPROCESS_USE_POSIX
-# include <boost/interprocess/sync/posix/interprocess_mutex.hpp>
 #endif
 
 #include <boost/interprocess/detail/config_end.hpp>

Modified: branches/release/boost/interprocess/sync/interprocess_recursive_mutex.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/interprocess_recursive_mutex.hpp (original)
+++ branches/release/boost/interprocess/sync/interprocess_recursive_mutex.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -36,7 +36,7 @@
 #include <boost/interprocess/detail/config_begin.hpp>
 #include <boost/interprocess/detail/workaround.hpp>
 #include <boost/interprocess/detail/posix_time_types_wrk.hpp>
-#include <cassert>
+#include <boost/assert.hpp>
 
 #if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && \
    (defined(BOOST_INTERPROCESS_POSIX_PROCESS_SHARED) && defined (BOOST_INTERPROCESS_POSIX_RECURSIVE_MUTEXES))
@@ -45,20 +45,29 @@
    #include <boost/interprocess/sync/posix/pthread_helpers.hpp>
    #define BOOST_INTERPROCESS_USE_POSIX
 #else
- #include <boost/interprocess/detail/atomic.hpp>
- #include <boost/cstdint.hpp>
- #include <boost/interprocess/detail/os_thread_functions.hpp>
- #include <boost/interprocess/sync/interprocess_mutex.hpp>
+ #include <boost/interprocess/sync/emulation/recursive_mutex.hpp>
    #define BOOST_INTERPROCESS_USE_GENERIC_EMULATION
 #endif
 
+#if defined (BOOST_INTERPROCESS_USE_GENERIC_EMULATION)
+namespace boost {
+namespace interprocess {
+namespace detail{
+namespace robust_emulation_helpers {
+
+template<class T>
+class mutex_traits;
+
+}}}}
+
+#endif
+
 /// @endcond
 
 //!\file
 //!Describes interprocess_recursive_mutex and shared_recursive_try_mutex classes
 
 namespace boost {
-
 namespace interprocess {
 
 //!Wraps a interprocess_mutex that can be placed in shared memory and can be
@@ -86,13 +95,13 @@
    //! mutex must be unlocked by the same mutex. The mutex must be unlocked
    //! the same number of times it is locked.
    //!Throws: interprocess_exception on error.
- void lock(void);
+ void lock();
 
    //!Tries to lock the interprocess_mutex, returns false when interprocess_mutex
    //!is already locked, returns true when success. The mutex must be unlocked
    //!the same number of times it is locked.
    //!Throws: interprocess_exception if a severe error is found
- bool try_lock(void);
+ bool try_lock();
 
    //!Tries to lock the interprocess_mutex, if interprocess_mutex can't be locked before
    //!abs_time time, returns false. The mutex must be unlocked
@@ -104,13 +113,14 @@
    //! If the mutex supports recursive locking, the mutex must be unlocked the
    //! same number of times it is locked.
    //!Throws: interprocess_exception on error.
- void unlock(void);
+ void unlock();
    /// @cond
    private:
+
    #if defined (BOOST_INTERPROCESS_USE_GENERIC_EMULATION)
- interprocess_mutex m_mutex;
- unsigned int m_nLockCount;
- volatile detail::OS_systemwide_thread_id_t m_nOwner;
+ void take_ownership(){ mutex.take_ownership(); }
+ friend class detail::robust_emulation_helpers::mutex_traits<interprocess_recursive_mutex>;
+ detail::emulation_recursive_mutex mutex;
    #else //#if defined (BOOST_INTERPROCESS_USE_GENERIC_EMULATION)
    pthread_mutex_t m_mut;
    #endif //#if (defined BOOST_INTERPROCESS_WINDOWS)
@@ -118,17 +128,29 @@
 };
 
 } //namespace interprocess {
-
 } //namespace boost {
 
 #ifdef BOOST_INTERPROCESS_USE_GENERIC_EMULATION
 # undef BOOST_INTERPROCESS_USE_GENERIC_EMULATION
-# include <boost/interprocess/sync/emulation/interprocess_recursive_mutex.hpp>
+
+namespace boost {
+namespace interprocess {
+
+inline interprocess_recursive_mutex::interprocess_recursive_mutex(){}
+inline interprocess_recursive_mutex::~interprocess_recursive_mutex(){}
+inline void interprocess_recursive_mutex::lock(){ mutex.lock(); }
+inline bool interprocess_recursive_mutex::try_lock(){ return mutex.try_lock(); }
+inline bool interprocess_recursive_mutex::timed_lock(const boost::posix_time::ptime &abs_time){ return mutex.timed_lock(abs_time); }
+inline void interprocess_recursive_mutex::unlock(){ mutex.unlock(); }
+
+} //namespace interprocess {
+} //namespace boost {
+
 #endif
 
 #ifdef BOOST_INTERPROCESS_USE_POSIX
 # undef BOOST_INTERPROCESS_USE_POSIX
-# include <boost/interprocess/sync/posix/interprocess_recursive_mutex.hpp>
+#include <boost/interprocess/sync/posix/interprocess_recursive_mutex.hpp>
 #endif
 
 #include <boost/interprocess/detail/config_end.hpp>

Modified: branches/release/boost/interprocess/sync/named_condition.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/named_condition.hpp (original)
+++ branches/release/boost/interprocess/sync/named_condition.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -27,6 +27,7 @@
 #include <boost/interprocess/detail/posix_time_types_wrk.hpp>
 #include <boost/interprocess/sync/emulation/named_creation_functor.hpp>
 #include <boost/interprocess/sync/named_mutex.hpp>
+#include <boost/interprocess/permissions.hpp>
 #if defined BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES
 #include <boost/interprocess/sync/interprocess_mutex.hpp>
 #include <boost/interprocess/sync/scoped_lock.hpp>
@@ -57,7 +58,7 @@
    public:
    //!Creates a global condition with a name.
    //!If the condition can't be created throws interprocess_exception
- named_condition(create_only_t create_only, const char *name);
+ named_condition(create_only_t create_only, const char *name, const permissions &perm = permissions());
 
    //!Opens or creates a global condition with a name.
    //!If the condition is created, this call is equivalent to
@@ -65,7 +66,7 @@
    //!If the condition is already created, this call is equivalent
    //!named_condition(open_only_t, ... )
    //!Does not throw
- named_condition(open_or_create_t open_or_create, const char *name);
+ named_condition(open_or_create_t open_or_create, const char *name, const permissions &perm = permissions());
 
    //!Opens a global condition with a name if that condition is previously
    //!created. If it is not previously created this function throws
@@ -199,7 +200,7 @@
 inline named_condition::~named_condition()
 {}
 
-inline named_condition::named_condition(create_only_t, const char *name)
+inline named_condition::named_condition(create_only_t, const char *name, const permissions &perm)
    : m_shmem (create_only
                ,name
                ,sizeof(condition_holder) +
@@ -207,10 +208,11 @@
                      ManagedOpenOrCreateUserOffset
                ,read_write
                ,0
- ,construct_func_t(detail::DoCreate))
+ ,construct_func_t(detail::DoCreate)
+ ,perm)
 {}
 
-inline named_condition::named_condition(open_or_create_t, const char *name)
+inline named_condition::named_condition(open_or_create_t, const char *name, const permissions &perm)
    : m_shmem (open_or_create
                ,name
                ,sizeof(condition_holder) +
@@ -218,7 +220,8 @@
                      ManagedOpenOrCreateUserOffset
                ,read_write
                ,0
- ,construct_func_t(detail::DoOpenOrCreate))
+ ,construct_func_t(detail::DoOpenOrCreate)
+ ,perm)
 {}
 
 inline named_condition::named_condition(open_only_t, const char *name)

Modified: branches/release/boost/interprocess/sync/named_mutex.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/named_mutex.hpp (original)
+++ branches/release/boost/interprocess/sync/named_mutex.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -21,6 +21,7 @@
 #include <boost/interprocess/exceptions.hpp>
 #include <boost/interprocess/sync/emulation/named_creation_functor.hpp>
 #include <boost/interprocess/detail/interprocess_tester.hpp>
+#include <boost/interprocess/permissions.hpp>
 
 #if defined(BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES)
    #include <boost/interprocess/sync/posix/semaphore_wrapper.hpp>
@@ -56,7 +57,7 @@
    public:
    //!Creates a global interprocess_mutex with a name.
    //!Throws interprocess_exception on error.
- named_mutex(create_only_t create_only, const char *name);
+ named_mutex(create_only_t create_only, const char *name, const permissions &perm = permissions());
 
    //!Opens or creates a global mutex with a name.
    //!If the mutex is created, this call is equivalent to
@@ -64,7 +65,7 @@
    //!If the mutex is already created, this call is equivalent
    //!named_mutex(open_only_t, ... )
    //!Does not throw
- named_mutex(open_or_create_t open_or_create, const char *name);
+ named_mutex(open_or_create_t open_or_create, const char *name, const permissions &perm = permissions());
 
    //!Opens a global mutex with a name if that mutex is previously
    //!created. If it is not previously created this function throws
@@ -122,16 +123,16 @@
 
 #if defined(BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES)
 
-inline named_mutex::named_mutex(create_only_t, const char *name)
- : m_sem(detail::DoCreate, name, read_write, 1)
+inline named_mutex::named_mutex(create_only_t, const char *name, const permissions &perm)
+ : m_sem(detail::DoCreate, name, 1, perm)
 {}
 
-inline named_mutex::named_mutex(open_or_create_t, const char *name)
- : m_sem(detail::DoOpenOrCreate, name, read_write, 1)
+inline named_mutex::named_mutex(open_or_create_t, const char *name, const permissions &perm)
+ : m_sem(detail::DoOpenOrCreate, name, 1, perm)
 {}
 
 inline named_mutex::named_mutex(open_only_t, const char *name)
- : m_sem(detail::DoOpen, name, read_write, 1)
+ : m_sem(detail::DoOpen, name, 1, permissions())
 {}
 
 inline void named_mutex::dont_close_on_destruction()
@@ -169,7 +170,7 @@
 inline named_mutex::~named_mutex()
 {}
 
-inline named_mutex::named_mutex(create_only_t, const char *name)
+inline named_mutex::named_mutex(create_only_t, const char *name, const permissions &perm)
    : m_shmem (create_only
                ,name
                ,sizeof(interprocess_mutex) +
@@ -177,10 +178,11 @@
                      ManagedOpenOrCreateUserOffset
                ,read_write
                ,0
- ,construct_func_t(detail::DoCreate))
+ ,construct_func_t(detail::DoCreate)
+ ,perm)
 {}
 
-inline named_mutex::named_mutex(open_or_create_t, const char *name)
+inline named_mutex::named_mutex(open_or_create_t, const char *name, const permissions &perm)
    : m_shmem (open_or_create
                ,name
                ,sizeof(interprocess_mutex) +
@@ -188,7 +190,8 @@
                      ManagedOpenOrCreateUserOffset
                ,read_write
                ,0
- ,construct_func_t(detail::DoOpenOrCreate))
+ ,construct_func_t(detail::DoOpenOrCreate)
+ ,perm)
 {}
 
 inline named_mutex::named_mutex(open_only_t, const char *name)

Modified: branches/release/boost/interprocess/sync/named_recursive_mutex.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/named_recursive_mutex.hpp (original)
+++ branches/release/boost/interprocess/sync/named_recursive_mutex.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -24,6 +24,7 @@
 #include <boost/interprocess/detail/managed_open_or_create_impl.hpp>
 #include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
 #include <boost/interprocess/sync/emulation/named_creation_functor.hpp>
+#include <boost/interprocess/permissions.hpp>
 
 //!\file
 //!Describes a named named_recursive_mutex class for inter-process synchronization
@@ -50,7 +51,7 @@
 
    //!Creates a global recursive_mutex with a name.
    //!If the recursive_mutex can't be created throws interprocess_exception
- named_recursive_mutex(create_only_t create_only, const char *name);
+ named_recursive_mutex(create_only_t create_only, const char *name, const permissions &perm = permissions());
 
    //!Opens or creates a global recursive_mutex with a name.
    //!If the recursive_mutex is created, this call is equivalent to
@@ -58,7 +59,7 @@
    //!If the recursive_mutex is already created, this call is equivalent
    //!named_recursive_mutex(open_only_t, ... )
    //!Does not throw
- named_recursive_mutex(open_or_create_t open_or_create, const char *name);
+ named_recursive_mutex(open_or_create_t open_or_create, const char *name, const permissions &perm = permissions());
 
    //!Opens a global recursive_mutex with a name if that recursive_mutex is previously
    //!created. If it is not previously created this function throws
@@ -116,7 +117,7 @@
 inline void named_recursive_mutex::dont_close_on_destruction()
 { detail::interprocess_tester::dont_close_on_destruction(m_shmem); }
 
-inline named_recursive_mutex::named_recursive_mutex(create_only_t, const char *name)
+inline named_recursive_mutex::named_recursive_mutex(create_only_t, const char *name, const permissions &perm)
    : m_shmem (create_only
                ,name
                ,sizeof(interprocess_recursive_mutex) +
@@ -124,10 +125,11 @@
                      ManagedOpenOrCreateUserOffset
                ,read_write
                ,0
- ,construct_func_t(detail::DoCreate))
+ ,construct_func_t(detail::DoCreate)
+ ,perm)
 {}
 
-inline named_recursive_mutex::named_recursive_mutex(open_or_create_t, const char *name)
+inline named_recursive_mutex::named_recursive_mutex(open_or_create_t, const char *name, const permissions &perm)
    : m_shmem (open_or_create
                ,name
                ,sizeof(interprocess_recursive_mutex) +
@@ -135,7 +137,8 @@
                      ManagedOpenOrCreateUserOffset
                ,read_write
                ,0
- ,construct_func_t(detail::DoOpenOrCreate))
+ ,construct_func_t(detail::DoOpenOrCreate)
+ ,perm)
 {}
 
 inline named_recursive_mutex::named_recursive_mutex(open_only_t, const char *name)

Modified: branches/release/boost/interprocess/sync/named_semaphore.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/named_semaphore.hpp (original)
+++ branches/release/boost/interprocess/sync/named_semaphore.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -19,6 +19,7 @@
 #include <boost/interprocess/detail/workaround.hpp>
 #include <boost/interprocess/creation_tags.hpp>
 #include <boost/interprocess/exceptions.hpp>
+#include <boost/interprocess/permissions.hpp>
 #include <boost/interprocess/detail/interprocess_tester.hpp>
 #include <boost/interprocess/detail/posix_time_types_wrk.hpp>
 
@@ -53,7 +54,7 @@
    public:
    //!Creates a global semaphore with a name, and an initial count.
    //!If the semaphore can't be created throws interprocess_exception
- named_semaphore(create_only_t, const char *name, unsigned int initialCount);
+ named_semaphore(create_only_t, const char *name, unsigned int initialCount, const permissions &perm = permissions());
 
    //!Opens or creates a global semaphore with a name, and an initial count.
    //!If the semaphore is created, this call is equivalent to
@@ -61,7 +62,7 @@
    //!If the semaphore is already created, this call is equivalent to
    //!named_semaphore(open_only_t, ... )
    //!and initialCount is ignored.
- named_semaphore(open_or_create_t, const char *name, unsigned int initialCount);
+ named_semaphore(open_or_create_t, const char *name, unsigned int initialCount, const permissions &perm = permissions());
 
    //!Opens a global semaphore with a name if that semaphore is previously.
    //!created. If it is not previously created this function throws
@@ -124,18 +125,17 @@
 #if defined(BOOST_INTERPROCESS_NAMED_SEMAPHORE_USES_POSIX_SEMAPHORES)
 
 inline named_semaphore::named_semaphore
- (create_only_t, const char *name, unsigned int initialCount)
- : m_sem(detail::DoCreate, name, read_write, initialCount)
+ (create_only_t, const char *name, unsigned int initialCount, const permissions &perm)
+ : m_sem(detail::DoCreate, name, initialCount, perm)
 {}
 
 inline named_semaphore::named_semaphore
- (open_or_create_t, const char *name, unsigned int initialCount)
- : m_sem(detail::DoOpenOrCreate, name, read_write, initialCount)
+ (open_or_create_t, const char *name, unsigned int initialCount, const permissions &perm)
+ : m_sem(detail::DoOpenOrCreate, name, initialCount, perm)
 {}
 
-inline named_semaphore::named_semaphore
- (open_only_t, const char *name)
- : m_sem(detail::DoOpen, name, read_write, 1)
+inline named_semaphore::named_semaphore(open_only_t, const char *name)
+ : m_sem(detail::DoOpen, name, 1, permissions())
 {}
 
 inline named_semaphore::~named_semaphore()
@@ -174,7 +174,7 @@
 { detail::interprocess_tester::dont_close_on_destruction(m_shmem); }
 
 inline named_semaphore::named_semaphore
- (create_only_t, const char *name, unsigned int initialCount)
+ (create_only_t, const char *name, unsigned int initialCount, const permissions &perm)
    : m_shmem (create_only
                ,name
                ,sizeof(interprocess_semaphore) +
@@ -182,11 +182,12 @@
                      ManagedOpenOrCreateUserOffset
                ,read_write
                ,0
- ,construct_func_t(detail::DoCreate, initialCount))
+ ,construct_func_t(detail::DoCreate, initialCount)
+ ,perm)
 {}
 
 inline named_semaphore::named_semaphore
- (open_or_create_t, const char *name, unsigned int initialCount)
+ (open_or_create_t, const char *name, unsigned int initialCount, const permissions &perm)
    : m_shmem (open_or_create
                ,name
                ,sizeof(interprocess_semaphore) +
@@ -194,7 +195,8 @@
                      ManagedOpenOrCreateUserOffset
                ,read_write
                ,0
- ,construct_func_t(detail::DoOpenOrCreate, initialCount))
+ ,construct_func_t(detail::DoOpenOrCreate, initialCount)
+ ,perm)
 {}
 
 inline named_semaphore::named_semaphore

Modified: branches/release/boost/interprocess/sync/named_upgradable_mutex.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/named_upgradable_mutex.hpp (original)
+++ branches/release/boost/interprocess/sync/named_upgradable_mutex.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -24,6 +24,7 @@
 #include <boost/interprocess/sync/interprocess_upgradable_mutex.hpp>
 #include <boost/interprocess/detail/posix_time_types_wrk.hpp>
 #include <boost/interprocess/sync/emulation/named_creation_functor.hpp>
+#include <boost/interprocess/permissions.hpp>
 
 //!\file
 //!Describes a named upgradable mutex class for inter-process synchronization
@@ -53,14 +54,14 @@
 
    //!Creates a global upgradable mutex with a name.
    //!If the upgradable mutex can't be created throws interprocess_exception
- named_upgradable_mutex(create_only_t create_only, const char *name);
+ named_upgradable_mutex(create_only_t create_only, const char *name, const permissions &perm = permissions());
 
    //!Opens or creates a global upgradable mutex with a name, and an initial count.
    //!If the upgradable mutex is created, this call is equivalent to
    //!named_upgradable_mutex(create_only_t, ...)
    //!If the upgradable mutex is already created, this call is equivalent to
    //!named_upgradable_mutex(open_only_t, ... ).
- named_upgradable_mutex(open_or_create_t open_or_create, const char *name);
+ named_upgradable_mutex(open_or_create_t open_or_create, const char *name, const permissions &perm = permissions());
 
    //!Opens a global upgradable mutex with a name if that upgradable mutex
    //!is previously.
@@ -239,7 +240,7 @@
 {}
 
 inline named_upgradable_mutex::named_upgradable_mutex
- (create_only_t, const char *name)
+ (create_only_t, const char *name, const permissions &perm)
    : m_shmem (create_only
                ,name
                ,sizeof(interprocess_upgradable_mutex) +
@@ -247,11 +248,12 @@
                      ManagedOpenOrCreateUserOffset
                ,read_write
                ,0
- ,construct_func_t(detail::DoCreate))
+ ,construct_func_t(detail::DoCreate)
+ ,perm)
 {}
 
 inline named_upgradable_mutex::named_upgradable_mutex
- (open_or_create_t, const char *name)
+ (open_or_create_t, const char *name, const permissions &perm)
    : m_shmem (open_or_create
                ,name
                ,sizeof(interprocess_upgradable_mutex) +
@@ -259,7 +261,8 @@
                      ManagedOpenOrCreateUserOffset
                ,read_write
                ,0
- ,construct_func_t(detail::DoOpenOrCreate))
+ ,construct_func_t(detail::DoOpenOrCreate)
+ ,perm)
 {}
 
 inline named_upgradable_mutex::named_upgradable_mutex

Modified: branches/release/boost/interprocess/sync/posix/interprocess_barrier.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/posix/interprocess_barrier.hpp (original)
+++ branches/release/boost/interprocess/sync/posix/interprocess_barrier.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -10,6 +10,7 @@
 
 #include<boost/interprocess/exceptions.hpp>
 #include <boost/interprocess/detail/posix_time_types_wrk.hpp>
+#include <boost/assert.hpp>
 
 namespace boost {
 namespace interprocess {
@@ -27,7 +28,7 @@
 inline barrier::~barrier()
 {
    int res = pthread_barrier_destroy(&m_barrier);
- assert(res == 0);(void)res;
+ BOOST_ASSERT(res == 0);(void)res;
 }
 
 inline bool barrier::wait()

Modified: branches/release/boost/interprocess/sync/posix/interprocess_condition.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/posix/interprocess_condition.hpp (original)
+++ branches/release/boost/interprocess/sync/posix/interprocess_condition.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -10,6 +10,7 @@
 
 #include <boost/interprocess/sync/posix/ptime_to_timespec.hpp>
 #include <boost/interprocess/detail/posix_time_types_wrk.hpp>
+#include <boost/assert.hpp>
 
 namespace boost {
 
@@ -21,7 +22,7 @@
    pthread_condattr_t cond_attr;
    res = pthread_condattr_init(&cond_attr);
    if(res != 0){
- throw interprocess_exception();
+ throw interprocess_exception("pthread_condattr_init failed");
    }
    res = pthread_condattr_setpshared(&cond_attr, PTHREAD_PROCESS_SHARED);
    if(res != 0){
@@ -39,21 +40,21 @@
 {
     int res = 0;
     res = pthread_cond_destroy(&m_condition);
- assert(res == 0);
+ BOOST_ASSERT(res == 0);
 }
 
 inline void interprocess_condition::notify_one()
 {
     int res = 0;
     res = pthread_cond_signal(&m_condition);
- assert(res == 0);
+ BOOST_ASSERT(res == 0);
 }
 
 inline void interprocess_condition::notify_all()
 {
     int res = 0;
     res = pthread_cond_broadcast(&m_condition);
- assert(res == 0);
+ BOOST_ASSERT(res == 0);
 }
 
 inline void interprocess_condition::do_wait(interprocess_mutex &mut)
@@ -61,7 +62,7 @@
    pthread_mutex_t* pmutex = &mut.m_mut;
    int res = 0;
    res = pthread_cond_wait(&m_condition, pmutex);
- assert(res == 0);
+ BOOST_ASSERT(res == 0);
 }
 
 inline bool interprocess_condition::do_timed_wait
@@ -71,7 +72,7 @@
    pthread_mutex_t* pmutex = &mut.m_mut;
    int res = 0;
    res = pthread_cond_timedwait(&m_condition, pmutex, &ts);
- assert(res == 0 || res == ETIMEDOUT);
+ BOOST_ASSERT(res == 0 || res == ETIMEDOUT);
 
    return res != ETIMEDOUT;
 }

Modified: branches/release/boost/interprocess/sync/posix/interprocess_mutex.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/posix/interprocess_mutex.hpp (original)
+++ branches/release/boost/interprocess/sync/posix/interprocess_mutex.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -30,6 +30,7 @@
 #ifndef BOOST_INTERPROCESS_POSIX_TIMEOUTS
 # include <boost/interprocess/detail/os_thread_functions.hpp>
 #endif
+#include <boost/assert.hpp>
 
 namespace boost {
 namespace interprocess {
@@ -44,7 +45,7 @@
 inline interprocess_mutex::~interprocess_mutex()
 {
    int res = pthread_mutex_destroy(&m_mut);
- assert(res == 0);(void)res;
+ BOOST_ASSERT(res == 0);(void)res;
 }
 
 inline void interprocess_mutex::lock()
@@ -103,7 +104,7 @@
 {
    int res = 0;
    res = pthread_mutex_unlock(&m_mut);
- assert(res == 0);
+ BOOST_ASSERT(res == 0);
 }
 
 } //namespace interprocess {

Modified: branches/release/boost/interprocess/sync/posix/interprocess_recursive_mutex.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/posix/interprocess_recursive_mutex.hpp (original)
+++ branches/release/boost/interprocess/sync/posix/interprocess_recursive_mutex.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -30,6 +30,7 @@
 #ifndef BOOST_INTERPROCESS_POSIX_TIMEOUTS
 # include <boost/interprocess/detail/os_thread_functions.hpp>
 #endif
+#include <boost/assert.hpp>
 
 namespace boost {
 
@@ -45,7 +46,7 @@
 inline interprocess_recursive_mutex::~interprocess_recursive_mutex()
 {
    int res = pthread_mutex_destroy(&m_mut);
- assert(res == 0);(void)res;
+ BOOST_ASSERT(res == 0);(void)res;
 }
 
 inline void interprocess_recursive_mutex::lock()
@@ -104,7 +105,7 @@
 {
    int res = 0;
    res = pthread_mutex_unlock(&m_mut);
- assert(res == 0);
+ BOOST_ASSERT(res == 0);
 }
 
 } //namespace interprocess {

Modified: branches/release/boost/interprocess/sync/posix/pthread_helpers.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/posix/pthread_helpers.hpp (original)
+++ branches/release/boost/interprocess/sync/posix/pthread_helpers.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -38,7 +38,7 @@
             pthread_mutexattr_setpshared(&m_attr, PTHREAD_PROCESS_SHARED)!= 0 ||
              (recursive &&
               pthread_mutexattr_settype(&m_attr, PTHREAD_MUTEX_RECURSIVE)!= 0 ))
- throw boost::interprocess::interprocess_exception();
+ throw interprocess_exception("pthread_mutexattr_xxxx failed");
       }
 
       //!Destructor
@@ -58,7 +58,7 @@
       {
          if(pthread_condattr_init(&m_attr)!=0 ||
             pthread_condattr_setpshared(&m_attr, PTHREAD_PROCESS_SHARED)!= 0)
- throw boost::interprocess::interprocess_exception();
+ throw interprocess_exception("pthread_condattr_xxxx failed");
       }
 
       //!Destructor
@@ -79,7 +79,7 @@
       : mp_mut(&mut)
       {
          if(pthread_mutex_init(mp_mut, &mut_attr) != 0)
- throw boost::interprocess::interprocess_exception();
+ throw interprocess_exception("pthread_mutex_init failed");
       }
 
      ~mutex_initializer() { if(mp_mut) pthread_mutex_destroy(mp_mut); }
@@ -98,7 +98,7 @@
       : mp_cond(&cond)
       {
          if(pthread_cond_init(mp_cond, &cond_attr)!= 0)
- throw boost::interprocess::interprocess_exception();
+ throw interprocess_exception("pthread_cond_init failed");
       }
 
      ~condition_initializer() { if(mp_cond) pthread_cond_destroy(mp_cond); }
@@ -121,7 +121,7 @@
       {
          if(pthread_barrierattr_init(&m_attr)!=0 ||
             pthread_barrierattr_setpshared(&m_attr, PTHREAD_PROCESS_SHARED)!= 0)
- throw boost::interprocess::interprocess_exception();
+ throw interprocess_exception("pthread_barrierattr_xxx failed");
       }
 
       //!Destructor
@@ -144,7 +144,7 @@
       : mp_barrier(&mut)
       {
          if(pthread_barrier_init(mp_barrier, &mut_attr, count) != 0)
- throw boost::interprocess::interprocess_exception();
+ throw interprocess_exception("pthread_barrier_init failed");
       }
 
      ~barrier_initializer() { if(mp_barrier) pthread_barrier_destroy(mp_barrier); }

Modified: branches/release/boost/interprocess/sync/posix/semaphore_wrapper.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/posix/semaphore_wrapper.hpp (original)
+++ branches/release/boost/interprocess/sync/posix/semaphore_wrapper.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -16,8 +16,10 @@
 #include <boost/interprocess/creation_tags.hpp>
 #include <boost/interprocess/detail/os_file_functions.hpp>
 #include <boost/interprocess/detail/tmp_dir_helpers.hpp>
+#include <boost/interprocess/permissions.hpp>
 #include <string>
 #include <semaphore.h>
+#include <boost/assert.hpp>
 
 #ifdef SEM_FAILED
 #define BOOST_INTERPROCESS_POSIX_SEM_FAILED (reinterpret_cast<sem_t*>(SEM_FAILED))
@@ -41,29 +43,18 @@
 namespace detail {
 
 inline bool semaphore_open
- (sem_t *&handle, detail::create_enum_t type, const char *origname, mode_t mode,
- unsigned int count)
+ (sem_t *&handle, detail::create_enum_t type, const char *origname,
+ unsigned int count, const permissions &perm = permissions())
 {
    std::string name;
    #ifndef BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SEMAPHORES
    detail::add_leading_slash(origname, name);
    #else
- detail::create_tmp_dir_and_get_filename(origname, name);
+ detail::create_tmp_and_clean_old_and_get_filename(origname, name);
    #endif
 
    //Create new mapping
    int oflag = 0;
- if(mode == read_only){
- oflag |= O_RDONLY;
- }
- else if(mode == read_write){
- oflag |= O_RDWR;
- }
- else{
- error_info err(mode_error);
- throw interprocess_exception(err);
- }
-
    switch(type){
       case detail::DoOpen:
          //No addition
@@ -83,7 +74,7 @@
 
    //Open file using POSIX API
    if(oflag & O_CREAT)
- handle = sem_open(name.c_str(), oflag, S_IRWXO | S_IRWXG | S_IRWXU, count);
+ handle = sem_open(name.c_str(), oflag, perm.get_permissions(), count);
    else
       handle = sem_open(name.c_str(), oflag);
 
@@ -99,7 +90,7 @@
 {
    int ret = sem_close(handle);
    if(ret != 0){
- assert(0);
+ BOOST_ASSERT(0);
    }
 }
 
@@ -134,7 +125,7 @@
 {
    int ret = sem_destroy(handle);
    if(ret != 0){
- assert(0);
+ BOOST_ASSERT(0);
    }
 }
 
@@ -204,8 +195,8 @@
 
    public:
    named_semaphore_wrapper
- (detail::create_enum_t type, const char *name, mode_t mode, unsigned int count)
- { semaphore_open(mp_sem, type, name, mode, count); }
+ (detail::create_enum_t type, const char *name, unsigned int count, const permissions &perm = permissions())
+ { semaphore_open(mp_sem, type, name, count, perm); }
 
    ~named_semaphore_wrapper()
    {

Modified: branches/release/boost/interprocess/sync/xsi/xsi_named_mutex.hpp
==============================================================================
--- branches/release/boost/interprocess/sync/xsi/xsi_named_mutex.hpp (original)
+++ branches/release/boost/interprocess/sync/xsi/xsi_named_mutex.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -27,9 +27,10 @@
 #include <boost/interprocess/exceptions.hpp>
 #include <boost/interprocess/sync/xsi/basic_xsi_semaphore.hpp>
 #include <cstddef>
-#include <cassert>
+#include <boost/assert.hpp>
 #include <boost/cstdint.hpp>
 #include <string>
+#include <boost/assert.hpp>
 
 //!\file
 //!Describes a class representing a xsi-based named_mutex.
@@ -198,7 +199,7 @@
 {
    bool success = xsi::simple_sem_op(m_semid, 1);
    (void)success;
- assert(success);
+ BOOST_ASSERT(success);
 }
 
 inline bool xsi_named_mutex::remove()

Modified: branches/release/boost/interprocess/windows_shared_memory.hpp
==============================================================================
--- branches/release/boost/interprocess/windows_shared_memory.hpp (original)
+++ branches/release/boost/interprocess/windows_shared_memory.hpp 2010-08-26 17:48:45 EDT (Thu, 26 Aug 2010)
@@ -14,6 +14,7 @@
 #include <boost/interprocess/detail/config_begin.hpp>
 #include <boost/interprocess/detail/workaround.hpp>
 #include <boost/detail/workaround.hpp>
+#include <boost/interprocess/permissions.hpp>
 
 #if !defined(BOOST_INTERPROCESS_WINDOWS)
 #error "This header can only be used in Windows operating systems"
@@ -62,24 +63,25 @@
    //!Creates a new native shared memory with name "name" and mode "mode",
    //!with the access mode "mode".
    //!If the file previously exists, throws an error.
- windows_shared_memory(create_only_t, const char *name, mode_t mode, std::size_t size)
- { this->priv_open_or_create(detail::DoCreate, name, mode, size); }
+ windows_shared_memory(create_only_t, const char *name, mode_t mode, std::size_t size, const permissions& perm = permissions())
+ { this->priv_open_or_create(detail::DoCreate, name, mode, size, perm); }
 
    //!Tries to create a shared memory object with name "name" and mode "mode", with the
    //!access mode "mode". If the file previously exists, it tries to open it with mode "mode".
    //!Otherwise throws an error.
- windows_shared_memory(open_or_create_t, const char *name, mode_t mode, std::size_t size)
- { this->priv_open_or_create(detail::DoOpenOrCreate, name, mode, size); }
+ windows_shared_memory(open_or_create_t, const char *name, mode_t mode, std::size_t size, const permissions& perm = permissions())
+ { this->priv_open_or_create(detail::DoOpenOrCreate, name, mode, size, perm); }
 
    //!Tries to open a shared memory object with name "name", with the access mode "mode".
    //!If the file does not previously exist, it throws an error.
    windows_shared_memory(open_only_t, const char *name, mode_t mode)
- { this->priv_open_or_create(detail::DoOpen, name, mode, 0); }
+ { this->priv_open_or_create(detail::DoOpen, name, mode, 0, permissions()); }
 
    //!Moves the ownership of "moved"'s shared memory object to *this.
    //!After the call, "moved" does not represent any shared memory object.
    //!Does not throw
    windows_shared_memory(BOOST_INTERPROCESS_RV_REF(windows_shared_memory) moved)
+ : m_handle(0)
    { this->swap(moved); }
 
    //!Moves the ownership of "moved"'s shared memory to *this.
@@ -117,7 +119,7 @@
    void priv_close();
 
    //!Closes a previously opened file mapping. Never throws.
- bool priv_open_or_create(detail::create_enum_t type, const char *filename, mode_t mode, std::size_t size);
+ bool priv_open_or_create(detail::create_enum_t type, const char *filename, mode_t mode, std::size_t size, const permissions& perm = permissions());
 
    void * m_handle;
    mode_t m_mode;
@@ -151,7 +153,7 @@
 { return m_mode; }
 
 inline bool windows_shared_memory::priv_open_or_create
- (detail::create_enum_t type, const char *filename, mode_t mode, std::size_t size)
+ (detail::create_enum_t type, const char *filename, mode_t mode, std::size_t size, const permissions& perm)
 {
    m_name = filename ? filename : "";
 
@@ -191,7 +193,8 @@
          __int64 s = size;
          unsigned long high_size(s >> 32), low_size((boost::uint32_t)s);
          m_handle = winapi::create_file_mapping
- (winapi::invalid_handle_value, file_map_access, high_size, low_size, filename);
+ ( winapi::invalid_handle_value, file_map_access, high_size, low_size, filename
+ , (winapi::interprocess_security_attributes*)perm.get_permissions());
       }
       break;
       default:


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