|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r61555 - in sandbox/move/boost: container container/detail intrusive intrusive/detail move
From: igaztanaga_at_[hidden]
Date: 2010-04-25 08:26:55
Author: igaztanaga
Date: 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
New Revision: 61555
URL: http://svn.boost.org/trac/boost/changeset/61555
Log:
Boost.Move review version
Text files modified:
sandbox/move/boost/container/deque.hpp | 247 +++++++++++-----------
sandbox/move/boost/container/detail/adaptive_node_pool_impl.hpp | 22 +-
sandbox/move/boost/container/detail/advanced_insert_int.hpp | 42 +--
sandbox/move/boost/container/detail/algorithms.hpp | 14
sandbox/move/boost/container/detail/allocation_type.hpp | 6
sandbox/move/boost/container/detail/config_begin.hpp | 97 +++++++++
sandbox/move/boost/container/detail/destroyers.hpp | 10
sandbox/move/boost/container/detail/flat_tree.hpp | 162 ++++++++------
sandbox/move/boost/container/detail/iterators.hpp | 14
sandbox/move/boost/container/detail/multiallocation_chain.hpp | 36 +-
sandbox/move/boost/container/detail/node_alloc_holder.hpp | 56 ++--
sandbox/move/boost/container/detail/node_pool_impl.hpp | 20
sandbox/move/boost/container/detail/pair.hpp | 74 ++++--
sandbox/move/boost/container/detail/pool_common.hpp | 4
sandbox/move/boost/container/detail/preprocessor.hpp | 18
sandbox/move/boost/container/detail/transform_iterator.hpp | 8
sandbox/move/boost/container/detail/tree.hpp | 103 +++------
sandbox/move/boost/container/detail/type_traits.hpp | 4
sandbox/move/boost/container/detail/utilities.hpp | 51 ++++
sandbox/move/boost/container/detail/value_init.hpp | 6
sandbox/move/boost/container/detail/variadic_templates_tools.hpp | 8
sandbox/move/boost/container/detail/version_type.hpp | 6
sandbox/move/boost/container/detail/workaround.hpp | 8
sandbox/move/boost/container/flat_map.hpp | 177 +++++++++-------
sandbox/move/boost/container/flat_set.hpp | 139 ++++++++---
sandbox/move/boost/container/list.hpp | 135 ++++++------
sandbox/move/boost/container/map.hpp | 112 +++++-----
sandbox/move/boost/container/set.hpp | 177 +++++++++-------
sandbox/move/boost/container/slist.hpp | 136 ++++++------
sandbox/move/boost/container/stable_vector.hpp | 116 ++++++----
sandbox/move/boost/container/string.hpp | 95 +++-----
sandbox/move/boost/container/vector.hpp | 238 ++++++++++-----------
sandbox/move/boost/intrusive/avl_set.hpp | 4
sandbox/move/boost/intrusive/avl_set_hook.hpp | 2
sandbox/move/boost/intrusive/avltree.hpp | 6
sandbox/move/boost/intrusive/avltree_algorithms.hpp | 2
sandbox/move/boost/intrusive/bs_set_hook.hpp | 2
sandbox/move/boost/intrusive/circular_list_algorithms.hpp | 2
sandbox/move/boost/intrusive/circular_slist_algorithms.hpp | 2
sandbox/move/boost/intrusive/derivation_value_traits.hpp | 11
sandbox/move/boost/intrusive/detail/any_node_and_algorithms.hpp | 6
sandbox/move/boost/intrusive/detail/hashtable_node.hpp | 31 +
sandbox/move/boost/intrusive/detail/is_stateful_value_traits.hpp | 21 +
sandbox/move/boost/intrusive/detail/list_node.hpp | 26 +-
sandbox/move/boost/intrusive/detail/slist_node.hpp | 26 +-
sandbox/move/boost/intrusive/detail/tree_algorithms.hpp | 6
sandbox/move/boost/intrusive/detail/tree_node.hpp | 28 +-
sandbox/move/boost/intrusive/detail/utilities.hpp | 97 +++++++-
sandbox/move/boost/intrusive/hashtable.hpp | 57 ++--
sandbox/move/boost/intrusive/linear_slist_algorithms.hpp | 2
sandbox/move/boost/intrusive/list.hpp | 28 ++
sandbox/move/boost/intrusive/list_hook.hpp | 2
sandbox/move/boost/intrusive/member_value_traits.hpp | 4
sandbox/move/boost/intrusive/rbtree.hpp | 27 +
sandbox/move/boost/intrusive/rbtree_algorithms.hpp | 2
sandbox/move/boost/intrusive/set.hpp | 23 +
sandbox/move/boost/intrusive/set_hook.hpp | 2
sandbox/move/boost/intrusive/sgtree.hpp | 4
sandbox/move/boost/intrusive/sgtree_algorithms.hpp | 2
sandbox/move/boost/intrusive/slist.hpp | 36 ++
sandbox/move/boost/intrusive/slist_hook.hpp | 2
sandbox/move/boost/intrusive/splay_set.hpp | 4
sandbox/move/boost/intrusive/splay_set_hook.hpp | 2
sandbox/move/boost/intrusive/splaytree.hpp | 4
sandbox/move/boost/intrusive/splaytree_algorithms.hpp | 2
sandbox/move/boost/intrusive/treap.hpp | 6
sandbox/move/boost/intrusive/treap_algorithms.hpp | 2
sandbox/move/boost/intrusive/treap_set.hpp | 4
sandbox/move/boost/intrusive/unordered_set.hpp | 40 +-
sandbox/move/boost/intrusive/unordered_set_hook.hpp | 8
sandbox/move/boost/move/move.hpp | 431 ++++++++++++++++++++++++++++++---------
71 files changed, 1999 insertions(+), 1308 deletions(-)
Modified: sandbox/move/boost/container/deque.hpp
==============================================================================
--- sandbox/move/boost/container/deque.hpp (original)
+++ sandbox/move/boost/container/deque.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 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,14 +15,14 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
-#include <boost/container/detail/utilities.hpp>
-#include <boost/container/detail/iterators.hpp>
-#include <boost/container/detail/algorithms.hpp>
-#include <boost/container/detail/mpl.hpp>
-#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_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
#include <cstddef>
#include <iterator>
#include <cassert>
@@ -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/move/move.hpp>
-#include <boost/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 {
@@ -89,8 +56,8 @@
typedef T value_type;
typedef A allocator_type;
static const bool trivial_dctr = boost::has_trivial_destructor<value_type>::value;
- static const bool trivial_dctr_after_move =
- boost::has_trivial_destructor_after_move<value_type>::value || trivial_dctr;
+ static const bool trivial_dctr_after_move = false;
+ //::boost::has_trivial_destructor_after_move<value_type>::value || trivial_dctr;
static const bool trivial_copy = has_trivial_copy<value_type>::value;
static const bool nothrow_copy = has_nothrow_copy<value_type>::value;
static const bool trivial_assign = has_trivial_assign<value_type>::value;
@@ -494,6 +461,8 @@
class deque : protected deque_base<T, Alloc>
{
/// @cond
+ typedef typename containers_detail::
+ move_const_ref_type<T>::type insert_const_ref_type;
typedef deque_base<T, Alloc> Base;
public: // Basic types
@@ -530,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::move_iterator<r_iterator> move_it;
+ typedef BOOST_CONTAINER_MOVE_NAMESPACE::move_iterator<r_iterator> move_it;
/// @endcond
@@ -626,7 +595,7 @@
}
}
- deque(BOOST_RV_REF(deque) mx)
+ deque(BOOST_MOVE_MACRO_RV_REF(deque) mx)
: Base(mx.alloc())
{ this->swap(mx); }
@@ -653,7 +622,7 @@
priv_destroy_range(this->members_.m_start, this->members_.m_finish);
}
- deque& operator= (BOOST_COPY_ASSIGN_REF(deque) x)
+ deque& operator= (BOOST_MOVE_MACRO_COPY_ASSIGN_REF(deque) x)
{
const size_type len = size();
if (&x != this) {
@@ -668,7 +637,7 @@
return *this;
}
- deque& operator= (BOOST_RV_REF(deque) x)
+ deque& operator= (BOOST_MOVE_MACRO_RV_REF(deque) x)
{
this->clear();
this->swap(x);
@@ -695,21 +664,21 @@
this->priv_assign_dispatch(first, last, Result());
}
- void push_back(const value_type& t)
- {
- if(this->priv_push_back_simple_available()){
- new(this->priv_push_back_simple_pos())value_type(t);
- this->priv_push_back_simple_commit();
- }
- else{
- this->priv_insert_aux(cend(), size_type(1), t);
- }
- }
+ #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_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_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::move(t));
+ new(this->priv_push_back_simple_pos())value_type(BOOST_CONTAINER_MOVE_NAMESPACE::move(t));
this->priv_push_back_simple_commit();
}
else{
@@ -717,21 +686,21 @@
}
}
- void push_front(const value_type& t)
- {
- if(this->priv_push_front_simple_available()){
- new(this->priv_push_front_simple_pos())value_type(t);
- this->priv_push_front_simple_commit();
- }
- else{
- this->priv_insert_aux(cbegin(), size_type(1), t);
- }
- }
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return priv_push_front(u); }
+ #endif
- void push_front(BOOST_RV_REF(value_type) t)
+ void push_front(insert_const_ref_type t)
+ { return priv_push_front(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::move(t));
+ new(this->priv_push_front_simple_pos())value_type(BOOST_CONTAINER_MOVE_NAMESPACE::move(t));
this->priv_push_front_simple_commit();
}
else{
@@ -759,31 +728,26 @@
this->priv_pop_front_aux();
}
- iterator insert(const_iterator position, const value_type& x)
- {
- if (position == cbegin()){
- this->push_front(x);
- return begin();
- }
- else if (position == cend()){
- this->push_back(x);
- return (end()-1);
- }
- else {
- size_type n = position - cbegin();
- this->priv_insert_aux(position, size_type(1), x);
- return iterator(this->begin() + n);
- }
- }
+ #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_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_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::move(mx));
+ this->push_front(BOOST_CONTAINER_MOVE_NAMESPACE::move(mx));
return begin();
}
else if (position == cend()) {
- this->push_back(boost::move(mx));
+ this->push_back(BOOST_CONTAINER_MOVE_NAMESPACE::move(mx));
return(end()-1);
}
else {
@@ -813,11 +777,12 @@
void emplace_back(Args&&... args)
{
if(this->priv_push_back_simple_available()){
- new(this->priv_push_back_simple_pos())value_type(boost::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{
- containers_detail::advanced_insert_aux_emplace<T, iterator, Args...> proxy(boost::forward<Args>(args)...);
+ typedef containers_detail::advanced_insert_aux_emplace<T, iterator, Args...> type;
+ type &&proxy = type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
this->priv_insert_aux_impl(this->cend(), 1, proxy);
}
}
@@ -826,11 +791,12 @@
void emplace_front(Args&&... args)
{
if(this->priv_push_front_simple_available()){
- new(this->priv_push_front_simple_pos())value_type(boost::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{
- containers_detail::advanced_insert_aux_emplace<T, iterator, Args...> proxy(boost::forward<Args>(args)...);
+ typedef containers_detail::advanced_insert_aux_emplace<T, iterator, Args...> type;
+ type &&proxy = type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
this->priv_insert_aux_impl(this->cbegin(), 1, proxy);
}
}
@@ -839,16 +805,17 @@
iterator emplace(const_iterator p, Args&&... args)
{
if(p == this->cbegin()){
- this->emplace_front(boost::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::forward<Args>(args)...);
+ this->emplace_back(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
return (this->end()-1);
}
else{
size_type n = p - this->cbegin();
- containers_detail::advanced_insert_aux_emplace<T, iterator, Args...> proxy(boost::forward<Args>(args)...);
+ typedef containers_detail::advanced_insert_aux_emplace<T, iterator, Args...> type;
+ 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::move_backward(begin(), iterator(pos), iterator(next));
+ BOOST_CONTAINER_MOVE_NAMESPACE::move_backward(begin(), iterator(pos), iterator(next));
pop_front();
}
else {
- boost::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::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::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);
@@ -1048,6 +1015,46 @@
/// @cond
private:
+ iterator priv_insert(const_iterator position, const value_type &x)
+ {
+ if (position == cbegin()){
+ this->push_front(x);
+ return begin();
+ }
+ else if (position == cend()){
+ this->push_back(x);
+ return (end()-1);
+ }
+ else {
+ size_type n = position - cbegin();
+ this->priv_insert_aux(position, size_type(1), x);
+ return iterator(this->begin() + n);
+ }
+ }
+
+ void priv_push_front(const value_type &t)
+ {
+ if(this->priv_push_front_simple_available()){
+ new(this->priv_push_front_simple_pos())value_type(t);
+ this->priv_push_front_simple_commit();
+ }
+ else{
+ this->priv_insert_aux(cbegin(), size_type(1), t);
+ }
+ }
+
+ void priv_push_back(const value_type &t)
+ {
+ if(this->priv_push_back_simple_available()){
+ new(this->priv_push_back_simple_pos())value_type(t);
+ this->priv_push_back_simple_commit();
+ }
+ else{
+ this->priv_insert_aux(cend(), size_type(1), t);
+ }
+ }
+
+
bool priv_push_back_simple_available() const
{
return this->members_.m_map &&
@@ -1080,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::move(value_type(*first)));
+ this->insert(pos, BOOST_CONTAINER_MOVE_NAMESPACE::move(value_type(*first)));
}
}
@@ -1132,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, val); }
template <class InpIt>
void priv_assign_dispatch(InpIt first, InpIt last, containers_detail::false_)
@@ -1169,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, x); }
template <class InpIt>
void priv_insert_dispatch(const_iterator pos,InpIt first, InpIt last, containers_detail::false_)
@@ -1208,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::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::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 {
@@ -1218,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::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);
}
@@ -1231,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::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::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::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);
}
@@ -1299,10 +1306,10 @@
++cur_node) {
FwdIt mid = first;
std::advance(mid, this->s_buffer_size());
- boost::uninitialized_copy_or_move(first, mid, *cur_node);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_copy_or_move(first, mid, *cur_node);
first = mid;
}
- boost::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));
@@ -1393,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::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::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 {
@@ -1405,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::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;
@@ -1463,7 +1470,7 @@
/// @cond
namespace boost {
-
+/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class T, class A>
@@ -1471,11 +1478,11 @@
{
enum { value = has_trivial_destructor<A>::value };
};
-
+*/
}
/// @endcond
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif // #ifndef BOOST_CONTAINERS_DEQUE_HPP
Modified: sandbox/move/boost/container/detail/adaptive_node_pool_impl.hpp
==============================================================================
--- sandbox/move/boost/container/detail/adaptive_node_pool_impl.hpp (original)
+++ sandbox/move/boost/container/detail/adaptive_node_pool_impl.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -15,17 +15,17 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/container_fwd.hpp>
-#include <boost/container/detail/workaround.hpp>
-#include <boost/container/detail/utilities.hpp>
+#include "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/container/detail/type_traits.hpp>
-#include <boost/container/detail/math_functions.hpp>
-#include <boost/container/detail/mpl.hpp>
-#include <boost/container/detail/pool_common.hpp>
+#include 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 <cassert>
#include <cstddef>
@@ -270,11 +270,11 @@
}
}
catch(...){
- this->deallocate_nodes(boost::move(chain));
+ this->deallocate_nodes(BOOST_CONTAINER_MOVE_NAMESPACE::move(chain));
throw;
}
priv_invariants();
- return boost::move(chain);
+ return BOOST_CONTAINER_MOVE_NAMESPACE::move(chain);
}
//!Deallocates a linked list of nodes. Never throws
@@ -633,6 +633,6 @@
} //namespace container {
} //namespace boost {
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //#ifndef BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP
Modified: sandbox/move/boost/container/detail/advanced_insert_int.hpp
==============================================================================
--- sandbox/move/boost/container/detail/advanced_insert_int.hpp (original)
+++ sandbox/move/boost/container/detail/advanced_insert_int.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -15,9 +15,9 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
-#include <boost/move/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
@@ -54,18 +54,18 @@
{ std::copy(first_, last_, p); }
virtual void uninitialized_copy_all_to(Iterator p)
- { boost::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::uninitialized_copy_or_move(first_, mid, pos);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_copy_or_move(first_, mid, pos);
first_ = mid;
}
else{
- boost::uninitialized_copy_or_move(mid, last_, pos);
+ ::BOOST_CONTAINER_MOVE_NAMESPACE::uninitialized_copy_or_move(mid, last_, pos);
last_ = mid;
}
}
@@ -163,8 +163,8 @@
#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
-#include <boost/container/detail/variadic_templates_tools.hpp>
-#include <boost/move/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
#include <typeinfo>
//#include <iostream> //For debugging purposes
@@ -180,7 +180,7 @@
typedef typename advanced_insert_aux_int<T, Iterator>::difference_type difference_type;
typedef typename build_number_seq<sizeof...(Args)>::type index_tuple_t;
- advanced_insert_aux_emplace(Args&&... args)
+ explicit advanced_insert_aux_emplace(Args&&... args)
: args_(args...), used_(false)
{}
@@ -204,8 +204,7 @@
void priv_copy_all_to(const index_tuple<IdxPack...>&, Iterator p)
{
if(!used_){
- T object(boost::forward<Args>(get<IdxPack>(args_))...);
- *p = boost::move(object);
+ *p = BOOST_CONTAINER_MOVE_NAMESPACE::move(T (BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(get<IdxPack>(args_))...));
used_ = true;
}
}
@@ -214,7 +213,7 @@
void priv_uninitialized_copy_all_to(const index_tuple<IdxPack...>&, Iterator p)
{
if(!used_){
- new(containers_detail::get_pointer(&*p))T(boost::forward<Args>(get<IdxPack>(args_))...);
+ new(containers_detail::get_pointer(&*p))T(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(get<IdxPack>(args_))...);
used_ = true;
}
}
@@ -225,7 +224,7 @@
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::forward<Args>(get<IdxPack>(args_))...);
+ new(containers_detail::get_pointer(&*p))T(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(get<IdxPack>(args_))...);
used_ = true;
}
}
@@ -237,8 +236,7 @@
assert(division_count <=1);
if((first_n && division_count == 1) || (!first_n && division_count == 0)){
if(!used_){
- T object(boost::forward<Args>(get<IdxPack>(args_))...);
- *p = boost::move(object);
+ *p = BOOST_CONTAINER_MOVE_NAMESPACE::move(T(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(get<IdxPack>(args_))...));
used_ = true;
}
}
@@ -251,8 +249,8 @@
#else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
-#include <boost/container/detail/preprocessor.hpp>
-#include <boost/container/detail/value_init.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
+#include INCLUDE_BOOST_CONTAINER_DETAIL_VALUE_INIT_HPP
namespace boost {
namespace container {
@@ -275,7 +273,7 @@
{
if(!used_){
value_init<T>v;
- *p = boost::move(v.m_t);
+ *p = BOOST_CONTAINER_MOVE_NAMESPACE::move(v.m_t);
used_ = true;
}
}
@@ -305,7 +303,7 @@
if((first_n && division_count == 1) || (!first_n && division_count == 0)){
if(!used_){
value_init<T>v;
- *p = boost::move(v.m_t);
+ *p = BOOST_CONTAINER_MOVE_NAMESPACE::move(v.m_t);
used_ = true;
}
}
@@ -329,7 +327,7 @@
{ \
if(!used_){ \
T v(BOOST_PP_ENUM(n, BOOST_CONTAINERS_PP_MEMBER_FORWARD, _)); \
- *p = boost::move(v); \
+ *p = BOOST_CONTAINER_MOVE_NAMESPACE::move(v); \
used_ = true; \
} \
} \
@@ -363,7 +361,7 @@
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::move(v); \
+ *p = BOOST_CONTAINER_MOVE_NAMESPACE::move(v); \
used_ = true; \
} \
} \
@@ -381,6 +379,6 @@
#endif //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //#ifndef BOOST_CONTAINERS_ADVANCED_INSERT_INT_HPP
Modified: sandbox/move/boost/container/detail/algorithms.hpp
==============================================================================
--- sandbox/move/boost/container/detail/algorithms.hpp (original)
+++ sandbox/move/boost/container/detail/algorithms.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -17,17 +17,17 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/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/container/detail/type_traits.hpp>
-#include <boost/container/detail/mpl.hpp>
-#include <boost/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/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //#ifndef BOOST_CONTAINERS_DETAIL_ALGORITHMS_HPP
Modified: sandbox/move/boost/container/detail/allocation_type.hpp
==============================================================================
--- sandbox/move/boost/container/detail/allocation_type.hpp (original)
+++ sandbox/move/boost/container/detail/allocation_type.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -15,8 +15,8 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/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/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //BOOST_CONTAINERS_ALLOCATION_TYPE_HPP
Modified: sandbox/move/boost/container/detail/config_begin.hpp
==============================================================================
--- sandbox/move/boost/container/detail/config_begin.hpp (original)
+++ sandbox/move/boost/container/detail/config_begin.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -10,6 +10,103 @@
#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_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: sandbox/move/boost/container/detail/destroyers.hpp
==============================================================================
--- sandbox/move/boost/container/detail/destroyers.hpp (original)
+++ sandbox/move/boost/container/detail/destroyers.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -17,10 +17,10 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
-#include <boost/container/detail/version_type.hpp>
-#include <boost/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/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //#ifndef BOOST_CONTAINERS_DESTROYERS_HPP
Modified: sandbox/move/boost/container/detail/flat_tree.hpp
==============================================================================
--- sandbox/move/boost/container/detail/flat_tree.hpp (original)
+++ sandbox/move/boost/container/detail/flat_tree.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -32,23 +32,23 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
-#include <boost/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/move/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
-#include <boost/container/detail/utilities.hpp>
-#include <boost/container/detail/pair.hpp>
-#include <boost/container/vector.hpp>
-#include <boost/container/detail/value_init.hpp>
-#include <boost/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_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_RV_REF(Data) d)
+ Data& operator=(BOOST_MOVE_MACRO_RV_REF(Data) d)
{
- value_compare::operator=(boost::move(static_cast<value_compare &>(d)));
- m_vect = boost::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_RV_REF(flat_tree) x)
- : m_data(boost::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_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_RV_REF(flat_tree) mx)
- { m_data = boost::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_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::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_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::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_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::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_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::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(boost::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::move<value_type>(val));
+ ret.first = priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move<value_type>(val));
}
return ret.first;
}
@@ -353,11 +367,11 @@
template <class... Args>
iterator emplace_hint_unique(const_iterator hint, Args&&... args)
{
- value_type val(boost::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::move<value_type>(val));
+ ret.first = priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move<value_type>(val));
}
return ret.first;
}
@@ -365,19 +379,19 @@
template <class... Args>
iterator emplace_equal(Args&&... args)
{
- value_type val(boost::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::move<value_type>(val));
+ i = this->m_data.m_vect.insert(i, BOOST_CONTAINER_MOVE_NAMESPACE::move<value_type>(val));
return i;
}
template <class... Args>
iterator emplace_hint_equal(const_iterator hint, Args&&... args)
{
- value_type val(boost::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::move<value_type>(val));
+ return priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move<value_type>(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::move<value_type>(val));
+ ret.first = priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move<value_type>(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::move<value_type>(val));
+ ret.first = priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move<value_type>(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::move<value_type>(val));
+ i = this->m_data.m_vect.insert(i, BOOST_CONTAINER_MOVE_NAMESPACE::move<value_type>(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::move<value_type>(val));
+ return priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move<value_type>(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::move<value_type>(val)); \
+ ret.first = priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move<value_type>(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::move<value_type>(val)); \
+ ret.first = priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move<value_type>(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::move<value_type>(val)); \
+ i = this->m_data.m_vect.insert(i, BOOST_CONTAINER_MOVE_NAMESPACE::move<value_type>(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::move<value_type>(val)); \
+ return priv_insert_commit(data, BOOST_CONTAINER_MOVE_NAMESPACE::move<value_type>(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_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::forward<Convertible>(convertible));
+ , BOOST_CONTAINER_MOVE_NAMESPACE::forward<Convertible>(convertible));
}
template <class RanIt>
@@ -844,7 +858,7 @@
} //namespace containers_detail {
} //namespace container {
-
+/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class K, class V, class KOV,
@@ -853,9 +867,9 @@
{
static const bool value = has_trivial_destructor<A>::value && has_trivial_destructor<C>::value;
};
-
+*/
} //namespace boost {
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif // BOOST_CONTAINERS_FLAT_TREE_HPP
Modified: sandbox/move/boost/container/detail/iterators.hpp
==============================================================================
--- sandbox/move/boost/container/detail/iterators.hpp (original)
+++ sandbox/move/boost/container/detail/iterators.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -18,14 +18,14 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
-#include <boost/move/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/container/detail/variadic_templates_tools.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP
#else
-#include <boost/container/detail/preprocessor.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
#endif
#include <iterator>
@@ -447,7 +447,7 @@
template<int ...IdxPack>
void inplace_impl(T* ptr, const containers_detail::index_tuple<IdxPack...>&)
- { ::new(ptr) T(boost::forward<Args>(containers_detail::get<IdxPack>(args_))...); }
+ { ::new(ptr) T(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(containers_detail::get<IdxPack>(args_))...); }
containers_detail::tuple<Args&&...> args_;
};
@@ -486,7 +486,7 @@
} //namespace container {
} //namespace boost {
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //#ifndef BOOST_CONTAINERS_DETAIL_ITERATORS_HPP
Modified: sandbox/move/boost/container/detail/multiallocation_chain.hpp
==============================================================================
--- sandbox/move/boost/container/detail/multiallocation_chain.hpp (original)
+++ sandbox/move/boost/container/detail/multiallocation_chain.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -11,14 +11,14 @@
#ifndef BOOST_CONTAINERS_DETAIL_MULTIALLOCATION_CHAIN_HPP
#define BOOST_CONTAINERS_DETAIL_MULTIALLOCATION_CHAIN_HPP
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/container_fwd.hpp>
-#include <boost/container/detail/utilities.hpp>
-#include <boost/container/detail/type_traits.hpp>
-#include <boost/container/detail/transform_iterator.hpp>
+#include "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/move/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_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_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_RV_REF(basic_multiallocation_chain) other)
+ basic_multiallocation_chain& operator=(BOOST_MOVE_MACRO_RV_REF(basic_multiallocation_chain) other)
{
- basic_multiallocation_chain tmp(boost::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_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_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_RV_REF(MultiallocationChain) other)
- : holder_(boost::move(other))
+ transform_multiallocation_chain(BOOST_MOVE_MACRO_RV_REF(MultiallocationChain) other)
+ : holder_(BOOST_CONTAINER_MOVE_NAMESPACE::move(other))
{}
- transform_multiallocation_chain& operator=(BOOST_RV_REF(transform_multiallocation_chain) other)
+ transform_multiallocation_chain& operator=(BOOST_MOVE_MACRO_RV_REF(transform_multiallocation_chain) other)
{
- transform_multiallocation_chain tmp(boost::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::move(holder_));
+ return MultiallocationChain(BOOST_CONTAINER_MOVE_NAMESPACE::move(holder_));
}
};
@@ -240,6 +240,6 @@
// namespace container {
// namespace boost {
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //BOOST_CONTAINERS_DETAIL_MULTIALLOCATION_CHAIN_HPP
Modified: sandbox/move/boost/container/detail/node_alloc_holder.hpp
==============================================================================
--- sandbox/move/boost/container/detail/node_alloc_holder.hpp (original)
+++ sandbox/move/boost/container/detail/node_alloc_holder.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -15,26 +15,26 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
#include <utility>
#include <functional>
-#include <boost/move/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
#include <boost/intrusive/options.hpp>
-#include <boost/container/detail/version_type.hpp>
-#include <boost/container/detail/type_traits.hpp>
-#include <boost/container/detail/utilities.hpp>
-#include <boost/container/detail/mpl.hpp>
-#include <boost/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/container/detail/preprocessor.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
#endif
-#include <boost/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_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_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::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_RV_REF(node_alloc_holder) other)
- : members_(boost::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_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_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_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_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::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::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::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::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::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::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::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/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif // BOOST_CONTAINERS_DETAIL_NODE_ALLOC_HPP_
Modified: sandbox/move/boost/container/detail/node_pool_impl.hpp
==============================================================================
--- sandbox/move/boost/container/detail/node_pool_impl.hpp (original)
+++ sandbox/move/boost/container/detail/node_pool_impl.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -15,17 +15,17 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/container_fwd.hpp>
-#include <boost/container/detail/workaround.hpp>
-#include <boost/container/detail/utilities.hpp>
+#include "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/container/detail/type_traits.hpp>
-#include <boost/container/detail/math_functions.hpp>
-#include <boost/container/detail/mpl.hpp>
-#include <boost/container/detail/pool_common.hpp>
+#include 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 <cassert>
#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::move(chain);
+ return BOOST_CONTAINER_MOVE_NAMESPACE::move(chain);
}
void deallocate_nodes(multiallocation_chain chain)
@@ -361,6 +361,6 @@
} //namespace container {
} //namespace boost {
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //#ifndef BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP
Modified: sandbox/move/boost/container/detail/pair.hpp
==============================================================================
--- sandbox/move/boost/container/detail/pair.hpp (original)
+++ sandbox/move/boost/container/detail/pair.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -17,18 +17,18 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
-#include <boost/container/detail/mpl.hpp>
-#include <boost/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/move/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
#ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
-#include <boost/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_RV_REF_2_TEMPL_ARGS(std::pair, D, S) p)
- : first(boost::move(p.first)), second(boost::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_RV_REF(pair) p)
- : first(boost::move(p.first)), second(boost::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_RV_REF_2_TEMPL_ARGS(pair, D, S) p)
- : first(boost::move(p.first)), second(boost::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::forward<U>(u))
- , second(boost::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::rv<pair> > >::type* = 0
+ < containers_detail::is_same<U, ::BOOST_CONTAINER_MOVE_NAMESPACE::rv<pair> > >::type* = 0
#endif
)
- : first(boost::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::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_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_RV_REF(pair) p)
+ pair& operator=(BOOST_MOVE_MACRO_RV_REF(pair) p)
{
- first = boost::move(p.first);
- second = boost::move(p.second);
+ first = BOOST_CONTAINER_MOVE_NAMESPACE::move(p.first);
+ second = BOOST_CONTAINER_MOVE_NAMESPACE::move(p.second);
return *this;
}
- pair& operator=(BOOST_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::move(p.first);
- second = boost::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_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::move(p.first);
- second = boost::move(p.second);
+ first = BOOST_CONTAINER_MOVE_NAMESPACE::move(p.first);
+ second = BOOST_CONTAINER_MOVE_NAMESPACE::move(p.second);
return *this;
}
@@ -191,8 +191,22 @@
} //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/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //#ifndef BOOST_CONTAINERS_DETAIL_PAIR_HPP
Modified: sandbox/move/boost/container/detail/pool_common.hpp
==============================================================================
--- sandbox/move/boost/container/detail/pool_common.hpp (original)
+++ sandbox/move/boost/container/detail/pool_common.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -15,7 +15,7 @@
# pragma once
#endif
-#include <boost/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/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //#ifndef BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP
Modified: sandbox/move/boost/container/detail/preprocessor.hpp
==============================================================================
--- sandbox/move/boost/container/detail/preprocessor.hpp (original)
+++ sandbox/move/boost/container/detail/preprocessor.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -15,8 +15,8 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
+#include "config_begin.hpp"
+#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 +36,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 +46,7 @@
//!
#endif
-#ifdef BOOST_HAS_RVALUE_REFS
+#ifndef BOOST_NO_RVALUE_REFERENCES
#define BOOST_CONTAINERS_PARAM(U, u) \
U && u \
//!
@@ -56,7 +56,7 @@
//!
#endif
-#ifdef BOOST_HAS_RVALUE_REFS
+#ifndef BOOST_NO_RVALUE_REFERENCES
#define BOOST_CONTAINERS_AUX_PARAM_INIT(z, n, data) \
BOOST_PP_CAT(m_p, n) (BOOST_PP_CAT(p, n)) \
//!
@@ -70,7 +70,7 @@
BOOST_PP_CAT(++m_p, n) \
//!
-#ifdef BOOST_HAS_RVALUE_REFS
+#ifndef BOOST_NO_RVALUE_REFERENCES
#define BOOST_CONTAINERS_AUX_PARAM_DEFINE(z, n, data) \
BOOST_PP_CAT(P, n) && BOOST_PP_CAT(m_p, n); \
//!
@@ -81,18 +81,18 @@
#endif
#define BOOST_CONTAINERS_PP_PARAM_FORWARD(z, n, data) \
-boost::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) ) \
//!
#define BOOST_CONTAINERS_PP_MEMBER_FORWARD(z, n, data) \
-boost::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(m_p, n) ) \
+BOOST_CONTAINER_MOVE_NAMESPACE::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(m_p, n) ) \
//!
#define BOOST_CONTAINERS_PP_MEMBER_IT_FORWARD(z, n, data) \
BOOST_PP_CAT(*m_p, n) \
//!
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#else
#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
Modified: sandbox/move/boost/container/detail/transform_iterator.hpp
==============================================================================
--- sandbox/move/boost/container/detail/transform_iterator.hpp (original)
+++ sandbox/move/boost/container/detail/transform_iterator.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -18,9 +18,9 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
-#include <boost/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 {
@@ -171,6 +171,6 @@
} //namespace container {
} //namespace boost {
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //#ifndef BOOST_CONTAINERS_DETAIL_TRANSFORM_ITERATORS_HPP
Modified: sandbox/move/boost/container/detail/tree.hpp
==============================================================================
--- sandbox/move/boost/container/detail/tree.hpp (original)
+++ sandbox/move/boost/container/detail/tree.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 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/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
-#include <boost/container/container_fwd.hpp>
+#include "config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
-#include <boost/move/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/container/detail/utilities.hpp>
-#include <boost/container/detail/algorithms.hpp>
-#include <boost/container/detail/node_alloc_holder.hpp>
-#include <boost/container/detail/destroyers.hpp>
-#include <boost/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/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::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_FWD_REF(Convertible) convertible)
- { new(ptr) node_type(boost::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_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_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_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_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::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_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::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::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::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::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::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_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::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_FWD_REF(MovableConvertible) mv)
+ iterator insert_equal(BOOST_MOVE_MACRO_FWD_REF(MovableConvertible) mv)
{
- NodePtr p(AllocHolder::create_node(boost::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_FWD_REF(MovableConvertible) mv)
+ iterator insert_equal(const_iterator hint, BOOST_MOVE_MACRO_FWD_REF(MovableConvertible) mv)
{
- NodePtr p(AllocHolder::create_node(boost::forward<MovableConvertible>(mv)));
+ NodePtr p(AllocHolder::create_node(BOOST_CONTAINER_MOVE_NAMESPACE::forward<MovableConvertible>(mv)));
return iterator(this->icont().insert_equal(hint.get(), *p));
}
@@ -1048,7 +1017,7 @@
} //namespace containers_detail {
} //namespace container {
-
+/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class K, class V, class KOV,
@@ -1058,9 +1027,9 @@
{
static const bool value = has_trivial_destructor<A>::value && has_trivial_destructor<C>::value;
};
-
+*/
} //namespace boost {
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //BOOST_CONTAINERS_TREE_HPP
Modified: sandbox/move/boost/container/detail/type_traits.hpp
==============================================================================
--- sandbox/move/boost/container/detail/type_traits.hpp (original)
+++ sandbox/move/boost/container/detail/type_traits.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -19,7 +19,7 @@
# pragma once
#endif
-#include <boost/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/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
Modified: sandbox/move/boost/container/detail/utilities.hpp
==============================================================================
--- sandbox/move/boost/container/detail/utilities.hpp (original)
+++ sandbox/move/boost/container/detail/utilities.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -11,8 +11,15 @@
#ifndef BOOST_CONTAINERS_DETAIL_UTILITIES_HPP
#define BOOST_CONTAINERS_DETAIL_UTILITIES_HPP
-#include <boost/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/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 {
@@ -91,11 +98,51 @@
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_member_pointer<T>::value || ::boost::is_enum<T>::value
+ ,const T &
+ ,BOOST_MOVE_MACRO_CATCH_CONST_RLVALUE(T)
+ >
+{};
+
} //namespace containers_detail {
} //namespace container {
} //namespace boost {
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //#ifndef BOOST_CONTAINERS_DETAIL_UTILITIES_HPP
Modified: sandbox/move/boost/container/detail/value_init.hpp
==============================================================================
--- sandbox/move/boost/container/detail/value_init.hpp (original)
+++ sandbox/move/boost/container/detail/value_init.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -17,8 +17,8 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/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/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //#ifndef BOOST_CONTAINERS_DETAIL_VALUE_INIT_HPP
Modified: sandbox/move/boost/container/detail/variadic_templates_tools.hpp
==============================================================================
--- sandbox/move/boost/container/detail/variadic_templates_tools.hpp (original)
+++ sandbox/move/boost/container/detail/variadic_templates_tools.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -15,9 +15,9 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
-#include <boost/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/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //#ifndef BOOST_CONTAINERS_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP
Modified: sandbox/move/boost/container/detail/version_type.hpp
==============================================================================
--- sandbox/move/boost/container/detail/version_type.hpp (original)
+++ sandbox/move/boost/container/detail/version_type.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -16,8 +16,10 @@
#ifndef BOOST_CONTAINERS_DETAIL_VERSION_TYPE_HPP
#define BOOST_CONTAINERS_DETAIL_VERSION_TYPE_HPP
-#include <boost/container/detail/mpl.hpp>
-#include <boost/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: sandbox/move/boost/container/detail/workaround.hpp
==============================================================================
--- sandbox/move/boost/container/detail/workaround.hpp (original)
+++ sandbox/move/boost/container/detail/workaround.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -11,14 +11,14 @@
#ifndef BOOST_CONTAINERS_DETAIL_WORKAROUND_HPP
#define BOOST_CONTAINERS_DETAIL_WORKAROUND_HPP
-#include <boost/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/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //#ifndef BOOST_CONTAINERS_DETAIL_WORKAROUND_HPP
Modified: sandbox/move/boost/container/flat_map.hpp
==============================================================================
--- sandbox/move/boost/container/flat_map.hpp (original)
+++ sandbox/move/boost/container/flat_map.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -15,19 +15,18 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
-#include <boost/container/container_fwd.hpp>
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
#include <utility>
#include <functional>
#include <memory>
#include <stdexcept>
-#include <boost/container/detail/flat_tree.hpp>
-#include <boost/container/detail/utilities.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_FLAT_TREE_HPP
#include <boost/type_traits/has_trivial_destructor.hpp>
-#include <boost/container/detail/mpl.hpp>
-#include <boost/move/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
namespace boost {
@@ -77,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>,
@@ -122,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.
@@ -184,14 +192,14 @@
//! <b>Complexity</b>: Construct.
//!
//! <b>Postcondition</b>: x is emptied.
- flat_map(BOOST_RV_REF(flat_map) x)
- : m_flat_tree(boost::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_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.
@@ -200,8 +208,8 @@
//! <b>Complexity</b>: Construct.
//!
//! <b>Postcondition</b>: x is emptied.
- flat_map<Key,T,Pred,Alloc>& operator=(BOOST_RV_REF(flat_map) mx)
- { m_flat_tree = boost::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.
@@ -377,13 +385,13 @@
//! Returns: A reference to the mapped_type corresponding to x in *this.
//!
//! Complexity: Logarithmic.
- T &operator[](BOOST_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::move(k), boost::move(T())));
+ i = insert(i, value_type(BOOST_CONTAINER_MOVE_NAMESPACE::move(k), BOOST_CONTAINER_MOVE_NAMESPACE::move(T())));
return (*i).second;
}
@@ -446,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_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::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.
@@ -461,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_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::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
@@ -491,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_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::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.
@@ -504,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_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::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.
@@ -539,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::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
@@ -555,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::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
@@ -765,7 +773,7 @@
/// @cond
} //namespace container {
-
+/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class K, class T, class C, class A>
@@ -773,7 +781,7 @@
{
static const bool value = has_trivial_destructor<A>::value && has_trivial_destructor<C>::value;
};
-
+*/
namespace container {
// Forward declaration of operators < and ==, needed for friend declaration.
@@ -810,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> >,
@@ -852,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.
@@ -915,21 +932,21 @@
//! <b>Complexity</b>: Construct.
//!
//! <b>Postcondition</b>: x is emptied.
- flat_multimap(BOOST_RV_REF(flat_multimap) x)
- : m_flat_tree(boost::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_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_RV_REF(flat_multimap) mx)
- { m_flat_tree = boost::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.
@@ -1076,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_RV_REF(value_type) x)
- { return force_copy<iterator>(m_flat_tree.insert_equal(boost::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.
@@ -1086,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_RV_REF(impl_value_type) x)
- { return force_copy<iterator>(m_flat_tree.insert_equal(boost::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.
@@ -1114,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_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::move(x)));
+ , BOOST_CONTAINER_MOVE_NAMESPACE::move(x)));
}
//! <b>Effects</b>: Inserts a value move constructed from x in the container.
@@ -1132,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_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::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.
@@ -1162,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::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.
@@ -1180,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::forward<Args>(args)...));
+ (force<impl_const_iterator>(hint), BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...));
}
#else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -1394,7 +1411,7 @@
/// @cond
namespace boost {
-
+/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class K, class T, class C, class A>
@@ -1402,11 +1419,11 @@
{
static const bool value = has_trivial_destructor<A>::value && has_trivial_destructor<C>::value;
};
-
+*/
} //namespace boost {
/// @endcond
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif /* BOOST_CONTAINERS_FLAT_MAP_HPP */
Modified: sandbox/move/boost/container/flat_set.hpp
==============================================================================
--- sandbox/move/boost/container/flat_set.hpp (original)
+++ sandbox/move/boost/container/flat_set.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -15,16 +15,16 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
-#include <boost/container/container_fwd.hpp>
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
#include <utility>
#include <functional>
#include <memory>
-#include <boost/container/detail/flat_tree.hpp>
-#include <boost/container/detail/mpl.hpp>
-#include <boost/move/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,9 +65,11 @@
{
/// @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::
+ move_const_ref_type<T>::type insert_const_ref_type;
/// @endcond
public:
@@ -137,21 +139,21 @@
//! <b>Complexity</b>: Construct.
//!
//! <b>Postcondition</b>: x is emptied.
- flat_set(BOOST_RV_REF(flat_set) mx)
- : m_flat_tree(boost::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_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_RV_REF(flat_set) mx)
- { m_flat_tree = boost::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.
@@ -326,8 +328,17 @@
//! 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(const value_type& x)
- { return m_flat_tree.insert_unique(x); }
+ std::pair<iterator, bool> insert(insert_const_ref_type x)
+ { return priv_insert(x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return priv_insert(u); }
+ #endif
//! <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.
@@ -340,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_RV_REF(value_type) x)
- { return m_flat_tree.insert_unique(boost::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.
@@ -354,8 +365,17 @@
//! 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, const value_type& x)
- { return m_flat_tree.insert_unique(position, x); }
+ iterator insert(const_iterator p, insert_const_ref_type x)
+ { return priv_insert(p, x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return priv_insert(position, u); }
+ #endif
//! <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.
@@ -366,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_RV_REF(value_type) x)
- { return m_flat_tree.insert_unique(position, boost::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.
//!
@@ -398,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::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
@@ -414,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::forward<Args>(args)...); }
+ { return m_flat_tree.emplace_hint_unique(hint, BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
#else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -577,6 +597,13 @@
template <class K1, class C1, class A1>
friend bool operator< (const flat_set<K1,C1,A1>&, const flat_set<K1,C1,A1>&);
+
+ private:
+ std::pair<iterator, bool> priv_insert(const T &x)
+ { return m_flat_tree.insert_unique(x); }
+
+ iterator priv_insert(const_iterator p, const T &x)
+ { return m_flat_tree.insert_unique(p, x); }
/// @endcond
};
@@ -617,7 +644,7 @@
/// @cond
} //namespace container {
-
+/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class T, class C, class A>
@@ -625,7 +652,7 @@
{
static const bool value = has_trivial_destructor<A>::value &&has_trivial_destructor<C>::value;
};
-
+*/
namespace container {
// Forward declaration of operators < and ==, needed for friend declaration.
@@ -658,9 +685,11 @@
{
/// @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::
+ move_const_ref_type<T>::type insert_const_ref_type;
/// @endcond
public:
@@ -711,15 +740,15 @@
flat_multiset(const flat_multiset<T,Pred,Alloc>& x)
: m_flat_tree(x.m_flat_tree) {}
- flat_multiset(BOOST_RV_REF(flat_multiset) x)
- : m_flat_tree(boost::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_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_RV_REF(flat_multiset) mx)
- { m_flat_tree = boost::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.
@@ -890,8 +919,17 @@
//! to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element it's inserted it might invalidate elements.
- iterator insert(const value_type& x)
- { return m_flat_tree.insert_equal(x); }
+ iterator insert(insert_const_ref_type x)
+ { return priv_insert(x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return priv_insert(u); }
+ #endif
//! <b>Effects</b>: Inserts a new value_type move constructed from x
//! and returns the iterator pointing to the newly inserted element.
@@ -900,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_RV_REF(value_type) x)
- { return m_flat_tree.insert_equal(boost::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.
@@ -913,8 +951,17 @@
//! 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, const value_type& x)
- { return m_flat_tree.insert_equal(position, x); }
+ iterator insert(const_iterator p, insert_const_ref_type x)
+ { return priv_insert(p, x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return priv_insert(position, u); }
+ #endif
//! <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.
@@ -926,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_RV_REF(value_type) x)
- { return m_flat_tree.insert_equal(position, boost::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.
//!
@@ -953,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::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.
@@ -968,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::forward<Args>(args)...); }
+ { return m_flat_tree.emplace_hint_equal(hint, BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
#else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -1132,6 +1179,12 @@
template <class K1, class C1, class A1>
friend bool operator< (const flat_multiset<K1,C1,A1>&,
const flat_multiset<K1,C1,A1>&);
+ private:
+ iterator priv_insert(const T &x)
+ { return m_flat_tree.insert_equal(x); }
+
+ iterator priv_insert(const_iterator p, const T &x)
+ { return m_flat_tree.insert_equal(p, x); }
/// @endcond
};
@@ -1172,7 +1225,7 @@
/// @cond
} //namespace container {
-
+/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class T, class C, class A>
@@ -1180,13 +1233,13 @@
{
static const bool value = has_trivial_destructor<A>::value && has_trivial_destructor<C>::value;
};
-
+*/
namespace container {
/// @endcond
}}
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif /* BOOST_CONTAINERS_FLAT_SET_HPP */
Modified: sandbox/move/boost/container/list.hpp
==============================================================================
--- sandbox/move/boost/container/list.hpp (original)
+++ sandbox/move/boost/container/list.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 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/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
-#include <boost/container/container_fwd.hpp>
-#include <boost/container/detail/version_type.hpp>
-#include <boost/move/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/container/detail/utilities.hpp>
-#include <boost/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/container/detail/mpl.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_MPL_HPP
#include <boost/intrusive/list.hpp>
-#include <boost/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/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::forward<Args>(args)...)
+ : m_data(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...)
{}
#else //#ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -164,8 +131,10 @@
<A, typename containers_detail::intrusive_list_type<A>::type>
{
/// @cond
+ typedef typename containers_detail::
+ move_const_ref_type<T>::type insert_const_ref_type;
typedef typename
- containers_detail::intrusive_list_type<A>::type Icont;
+ containers_detail::intrusive_list_type<A>::type Icont;
typedef list <T, A> ThisType;
typedef containers_detail::node_alloc_holder<A, Icont> AllocHolder;
typedef typename AllocHolder::NodePtr NodePtr;
@@ -229,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;
@@ -388,8 +357,8 @@
//! <b>Throws</b>: If allocator_type's copy constructor throws.
//!
//! <b>Complexity</b>: Constant.
- list(BOOST_RV_REF(list) x)
- : AllocHolder(boost::move((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
@@ -567,33 +536,50 @@
//! T's copy constructor throws.
//!
//! <b>Complexity</b>: Amortized constant time.
- void push_front(const T& x)
+ void push_front(insert_const_ref_type x)
{ this->insert(this->cbegin(), x); }
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { this->insert(this->cbegin(), u); }
+ #endif
+
//! <b>Effects</b>: Constructs a new element in the beginning of the list
//! and moves the resources of t to this new element.
//!
//! <b>Throws</b>: If memory allocation throws.
//!
//! <b>Complexity</b>: Amortized constant time.
- void push_front(BOOST_RV_REF(T) x)
- { this->insert(this->cbegin(), boost::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.
//!
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Amortized constant time.
- void push_back (const T& x)
+ void push_back (insert_const_ref_type x)
{ this->insert(this->cend(), x); }
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { this->insert(this->cend(), u); }
+
+ #endif
+
//! <b>Effects</b>: Removes the first element from the list.
//!
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Amortized constant time.
- void push_back (BOOST_RV_REF(T) x)
- { this->insert(this->cend(), boost::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.
//!
@@ -730,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_COPY_ASSIGN_REF(ThisType) x)
+ ThisType& operator=(BOOST_MOVE_MACRO_COPY_ASSIGN_REF(ThisType) x)
{
if (this != &x) {
this->assign(x.begin(), x.end());
@@ -746,7 +732,7 @@
//! <b>Throws</b>: If allocator_type's copy constructor throws.
//!
//! <b>Complexity</b>: Constant.
- ThisType& operator=(BOOST_RV_REF(ThisType) mx)
+ ThisType& operator=(BOOST_MOVE_MACRO_RV_REF(ThisType) mx)
{
this->clear();
this->swap(mx);
@@ -786,11 +772,16 @@
//! <b>Throws</b>: If memory allocation throws or x's copy constructor throws.
//!
//! <b>Complexity</b>: Amortized constant time.
- iterator insert(const_iterator p, const T& x)
- {
- NodePtr tmp = AllocHolder::create_node(x);
- return iterator(this->icont().insert(p.get(), *tmp));
- }
+ iterator insert(const_iterator position, insert_const_ref_type x)
+ { return this->priv_insert(position, x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return this->priv_insert(position, u); }
+ #endif
//! <b>Requires</b>: p must be a valid iterator of *this.
//!
@@ -799,9 +790,9 @@
//! <b>Throws</b>: If memory allocation throws.
//!
//! <b>Complexity</b>: Amortized constant time.
- iterator insert(const_iterator p, BOOST_RV_REF(T) x)
+ iterator insert(const_iterator p, BOOST_MOVE_MACRO_RV_REF(T) x)
{
- NodePtr tmp = AllocHolder::create_node(boost::move(x));
+ NodePtr tmp = AllocHolder::create_node(BOOST_CONTAINER_MOVE_NAMESPACE::move(x));
return iterator(this->icont().insert(p.get(), *tmp));
}
@@ -817,7 +808,7 @@
template <class... Args>
void emplace_back(Args&&... args)
{
- this->emplace(this->cend(), boost::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
@@ -830,7 +821,7 @@
template <class... Args>
void emplace_front(Args&&... args)
{
- this->emplace(this->cbegin(), boost::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
@@ -844,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::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));
@@ -1169,6 +1160,12 @@
/// @cond
private:
+ iterator priv_insert(const_iterator p, const T &x)
+ {
+ NodePtr tmp = AllocHolder::create_node(x);
+ return iterator(this->icont().insert(p.get(), *tmp));
+ }
+
//Iterator range version
template<class InpIterator>
void priv_create_and_insert_nodes
@@ -1354,7 +1351,7 @@
/// @cond
} //namespace container {
-
+/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class T, class A>
@@ -1362,13 +1359,13 @@
{
static const bool value = has_trivial_destructor<A>::value;
};
-
+*/
namespace container {
/// @endcond
}}
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif // BOOST_CONTAINERS_LIST_HPP_
Modified: sandbox/move/boost/container/map.hpp
==============================================================================
--- sandbox/move/boost/container/map.hpp (original)
+++ sandbox/move/boost/container/map.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -47,21 +47,21 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
-#include <boost/container/container_fwd.hpp>
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
#include <utility>
#include <functional>
#include <memory>
#include <stdexcept>
-#include <boost/container/detail/tree.hpp>
-#include <boost/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/container/detail/mpl.hpp>
-#include <boost/container/detail/utilities.hpp>
-#include <boost/container/detail/pair.hpp>
-#include <boost/move/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_RV_REF(map) x)
- : m_tree(boost::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_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_RV_REF(map) x)
- { m_tree = boost::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::move(v.m_t));
- i = insert(i, boost::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::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_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::move(k), boost::move(T()));
- i = insert(i, boost::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_RV_REF(nonconst_value_type) x)
- { return m_tree.insert_unique(boost::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_RV_REF(nonconst_impl_value_type) x)
- { return m_tree.insert_unique(boost::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_RV_REF(value_type) x)
- { return m_tree.insert_unique(boost::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_RV_REF(nonconst_value_type) x)
- { return m_tree.insert_unique(position, boost::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_RV_REF(nonconst_impl_value_type) x)
- { return m_tree.insert_unique(position, boost::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_RV_REF(value_type) x)
- { return m_tree.insert_unique(position, boost::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::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::forward<Args>(args)...); }
+ { return m_tree.emplace_hint_unique(hint, BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
#else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -721,7 +721,7 @@
const multimap<Key,T,Pred,Alloc>& y);
} //namespace container {
-
+/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class K, class T, class C, class A>
@@ -729,7 +729,7 @@
{
static const bool value = has_trivial_destructor<A>::value && has_trivial_destructor<C>::value;
};
-
+*/
namespace container {
/// @endcond
@@ -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_RV_REF(multimap) x)
- : m_tree(boost::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_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_RV_REF(multimap) x)
- { m_tree = boost::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_RV_REF(nonconst_value_type) x)
- { return m_tree.insert_equal(boost::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_RV_REF(nonconst_impl_value_type) x)
- { return m_tree.insert_equal(boost::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_RV_REF(nonconst_value_type) x)
- { return m_tree.insert_equal(position, boost::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_RV_REF(nonconst_impl_value_type) x)
- { return m_tree.insert_equal(position, boost::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::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::forward<Args>(args)...); }
+ { return m_tree.emplace_hint_equal(hint, BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
#else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -1265,7 +1265,7 @@
/// @cond
} //namespace container {
-
+/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class K, class T, class C, class A>
@@ -1273,14 +1273,14 @@
{
static const bool value = has_trivial_destructor<A>::value && has_trivial_destructor<C>::value;
};
-
+*/
namespace container {
/// @endcond
}}
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif /* BOOST_CONTAINERS_MAP_HPP */
Modified: sandbox/move/boost/container/set.hpp
==============================================================================
--- sandbox/move/boost/container/set.hpp (original)
+++ sandbox/move/boost/container/set.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 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/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
-#include <boost/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/move/move.hpp>
-#include <boost/container/detail/mpl.hpp>
-#include <boost/container/detail/tree.hpp>
-#include <boost/move/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/container/detail/preprocessor.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
#endif
#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -94,10 +62,12 @@
{
/// @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
+ typedef typename containers_detail::
+ move_const_ref_type<T>::type insert_const_ref_type;
/// @endcond
public:
@@ -166,21 +136,21 @@
//! <b>Complexity</b>: Construct.
//!
//! <b>Postcondition</b>: x is emptied.
- set(BOOST_RV_REF(set) x)
- : m_tree(boost::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_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_RV_REF(set) x)
- { m_tree = boost::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.
@@ -352,8 +322,17 @@
//! points to the element with key equivalent to the key of x.
//!
//! <b>Complexity</b>: Logarithmic.
- std::pair<iterator,bool> insert(const value_type& x)
- { return m_tree.insert_unique(x); }
+ std::pair<iterator,bool> insert(insert_const_ref_type x)
+ { return priv_insert(x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return priv_insert(u); }
+ #endif
//! <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.
@@ -363,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_RV_REF(value_type) x)
- { return m_tree.insert_unique(boost::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.
@@ -375,8 +354,17 @@
//!
//! <b>Complexity</b>: Logarithmic in general, but amortized constant if t
//! is inserted right before p.
- iterator insert(const_iterator p, const value_type& x)
- { return m_tree.insert_unique(p, x); }
+ iterator insert(const_iterator p, insert_const_ref_type x)
+ { return priv_insert(p, x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return priv_insert(position, u); }
+ #endif
//! <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.
@@ -384,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_RV_REF(value_type) x)
- { return m_tree.insert_unique(p, boost::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.
//!
@@ -411,7 +399,7 @@
//! <b>Complexity</b>: Logarithmic.
template <class... Args>
iterator emplace(Args&&... args)
- { return m_tree.emplace_unique(boost::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
@@ -424,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::forward<Args>(args)...); }
+ { return m_tree.emplace_hint_unique(hint, BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
#else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -550,6 +538,14 @@
template <class K1, class C1, class A1>
friend bool operator< (const set<K1,C1,A1>&, const set<K1,C1,A1>&);
+
+ private:
+ std::pair<iterator, bool> priv_insert(const T &x)
+ { return m_tree.insert_unique(x); }
+
+ iterator priv_insert(const_iterator p, const T &x)
+ { return m_tree.insert_unique(p, x); }
+
/// @endcond
};
@@ -590,7 +586,7 @@
/// @cond
} //namespace container {
-
+/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class T, class C, class A>
@@ -598,7 +594,7 @@
{
static const bool value = has_trivial_destructor<A>::value && has_trivial_destructor<C>::value;
};
-
+*/
namespace container {
// Forward declaration of operators < and ==, needed for friend declaration.
@@ -624,10 +620,12 @@
{
/// @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
+ typedef typename containers_detail::
+ move_const_ref_type<T>::type insert_const_ref_type;
/// @endcond
public:
@@ -697,21 +695,21 @@
//! <b>Complexity</b>: Construct.
//!
//! <b>Postcondition</b>: x is emptied.
- multiset(BOOST_RV_REF(multiset) x)
- : m_tree(boost::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_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_RV_REF(multiset) x)
- { m_tree = boost::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.
@@ -879,8 +877,17 @@
//! newly inserted element.
//!
//! <b>Complexity</b>: Logarithmic.
- iterator insert(const value_type& x)
- { return m_tree.insert_equal(x); }
+ iterator insert(insert_const_ref_type x)
+ { return priv_insert(x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return priv_insert(u); }
+ #endif
//! <b>Effects</b>: Inserts a copy of x in the container.
//!
@@ -889,8 +896,8 @@
//!
//! <b>Complexity</b>: Logarithmic in general, but amortized constant if t
//! is inserted right before p.
- iterator insert(BOOST_RV_REF(value_type) x)
- { return m_tree.insert_equal(boost::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.
@@ -900,8 +907,17 @@
//!
//! <b>Complexity</b>: Logarithmic in general, but amortized constant if t
//! is inserted right before p.
- iterator insert(const_iterator p, const value_type& x)
- { return m_tree.insert_equal(p, x); }
+ iterator insert(const_iterator p, insert_const_ref_type x)
+ { return priv_insert(p, x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return priv_insert(position, u); }
+ #endif
//! <b>Effects</b>: Inserts a value move constructed from x in the container.
//! p is a hint pointing to where the insert should start to search.
@@ -911,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_RV_REF(value_type) x)
- { return m_tree.insert_equal(p, boost::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.
//!
@@ -932,7 +948,7 @@
//! <b>Complexity</b>: Logarithmic.
template <class... Args>
iterator emplace(Args&&... args)
- { return m_tree.emplace_equal(boost::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)...
@@ -944,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::forward<Args>(args)...); }
+ { return m_tree.emplace_hint_equal(hint, BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...); }
#else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -1071,6 +1087,13 @@
template <class K1, class C1, class A1>
friend bool operator< (const multiset<K1,C1,A1>&,
const multiset<K1,C1,A1>&);
+ private:
+ iterator priv_insert(const T &x)
+ { return m_tree.insert_equal(x); }
+
+ iterator priv_insert(const_iterator p, const T &x)
+ { return m_tree.insert_equal(p, x); }
+
/// @endcond
};
@@ -1111,7 +1134,7 @@
/// @cond
} //namespace container {
-
+/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class T, class C, class A>
@@ -1119,14 +1142,14 @@
{
static const bool value = has_trivial_destructor<A>::value && has_trivial_destructor<C>::value;
};
-
+*/
namespace container {
/// @endcond
}}
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif /* BOOST_CONTAINERS_SET_HPP */
Modified: sandbox/move/boost/container/slist.hpp
==============================================================================
--- sandbox/move/boost/container/slist.hpp (original)
+++ sandbox/move/boost/container/slist.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 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/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
-#include <boost/container/container_fwd.hpp>
-#include <boost/move/move.hpp>
+#include INCLUDE_BOOST_CONTAINER_CONTAINER_FWD_HPP
+#include INCLUDE_BOOST_CONTAINER_MOVE_HPP
#include <boost/pointer_to_other.hpp>
-#include <boost/container/detail/utilities.hpp>
-#include <boost/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/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/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::forward<Args>(args)...)
+ : m_data(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...)
{}
#else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -188,6 +156,8 @@
<A, typename containers_detail::intrusive_slist_type<A>::type>
{
/// @cond
+ typedef typename containers_detail::
+ move_const_ref_type<T>::type insert_const_ref_type;
typedef typename
containers_detail::intrusive_slist_type<A>::type Icont;
typedef containers_detail::node_alloc_holder<A, Icont> AllocHolder;
@@ -252,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;
@@ -402,8 +372,8 @@
//! <b>Throws</b>: If allocator_type's copy constructor throws.
//!
//! <b>Complexity</b>: Constant.
- slist(BOOST_RV_REF(slist) x)
- : AllocHolder(boost::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.
@@ -414,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_COPY_ASSIGN_REF(slist) x)
+ slist& operator= (BOOST_MOVE_MACRO_COPY_ASSIGN_REF(slist) x)
{
if (&x != this){
this->assign(x.begin(), x.end());
@@ -430,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_RV_REF(slist) mx)
+ slist& operator= (BOOST_MOVE_MACRO_RV_REF(slist) mx)
{
if (&mx != this){
this->clear();
@@ -626,8 +596,16 @@
//! T's copy constructor throws.
//!
//! <b>Complexity</b>: Amortized constant time.
- void push_front(const value_type& x)
- { this->icont().push_front(*this->create_node(x)); }
+ void push_front(insert_const_ref_type x)
+ { return priv_push_front(x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return priv_push_front(u); }
+ #endif
//! <b>Effects</b>: Constructs a new element in the beginning of the list
//! and moves the resources of t to this new element.
@@ -635,8 +613,8 @@
//! <b>Throws</b>: If memory allocation throws.
//!
//! <b>Complexity</b>: Amortized constant time.
- void push_front(BOOST_RV_REF(T) x)
- { this->icont().push_front(*this->create_node(boost::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.
//!
@@ -679,8 +657,17 @@
//!
//! <b>Note</b>: Does not affect the validity of iterators and references of
//! previous values.
- iterator insert_after(const_iterator prev_pos, const value_type& x)
- { return iterator(this->icont().insert_after(prev_pos.get(), *this->create_node(x))); }
+ iterator insert_after(const_iterator prev_pos, insert_const_ref_type x)
+ { return this->priv_insert_after(prev_pos, x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return this->priv_insert_after(position, u); }
+ #endif
//! <b>Requires</b>: prev_pos must be a valid iterator of *this.
//!
@@ -695,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_RV_REF(value_type) x)
- { return iterator(this->icont().insert_after(prev_pos.get(), *this->create_node(boost::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.
//!
@@ -738,8 +725,17 @@
//! <b>Throws</b>: If memory allocation throws or x's copy constructor throws.
//!
//! <b>Complexity</b>: Linear to the elements before p.
- iterator insert(const_iterator p, const value_type& x)
- { return this->insert_after(previous(p), x); }
+ iterator insert(const_iterator position, insert_const_ref_type x)
+ { return this->priv_insert(position, x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return this->priv_insert(position, u); }
+ #endif
//! <b>Requires</b>: p must be a valid iterator of *this.
//!
@@ -748,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_RV_REF(value_type) x)
- { return this->insert_after(previous(p), boost::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.
//!
@@ -785,7 +781,7 @@
//! <b>Complexity</b>: Amortized constant time.
template <class... Args>
void emplace_front(Args&&... args)
- { this->emplace_after(this->cbefore_begin(), boost::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
@@ -796,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::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
@@ -809,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::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));
@@ -1258,6 +1254,14 @@
/// @cond
private:
+ iterator priv_insert(const_iterator p, const value_type& x)
+ { return this->insert_after(previous(p), x); }
+
+ iterator priv_insert_after(const_iterator prev_pos, const value_type& x)
+ { return iterator(this->icont().insert_after(prev_pos.get(), *this->create_node(x))); }
+
+ void priv_push_front(const value_type &x)
+ { this->icont().push_front(*this->create_node(x)); }
//Iterator range version
template<class InpIterator>
@@ -1334,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)
{
@@ -1376,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_)
@@ -1464,7 +1468,7 @@
/// @cond
namespace boost {
-
+/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class T, class A>
@@ -1472,7 +1476,7 @@
{
static const bool value = has_trivial_destructor<A>::value;
};
-
+*/
namespace container {
/// @endcond
@@ -1523,6 +1527,6 @@
///@endcond
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif /* BOOST_CONTAINERS_SLIST_HPP */
Modified: sandbox/move/boost/container/stable_vector.hpp
==============================================================================
--- sandbox/move/boost/container/stable_vector.hpp (original)
+++ sandbox/move/boost/container/stable_vector.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -22,18 +22,18 @@
# pragma once
#endif
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
-#include <boost/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/container/detail/version_type.hpp>
-#include <boost/container/detail/multiallocation_chain.hpp>
-#include <boost/container/detail/utilities.hpp>
-#include <boost/container/detail/iterators.hpp>
-#include <boost/container/detail/algorithms.hpp>
+#include 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/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::forward<Args>(args)...)
+ : value(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...)
{}
#else //BOOST_CONTAINERS_PERFECT_FORWARDING
@@ -166,13 +166,13 @@
T value;
};
-template<typename T, typename Value, typename Pointer>
+template<typename T, typename Reference, typename Pointer>
class iterator
: public std::iterator< std::random_access_iterator_tag
- , const typename std::iterator_traits<Pointer>::value_type
+ , typename std::iterator_traits<Pointer>::value_type
, typename std::iterator_traits<Pointer>::difference_type
, Pointer
- , Value &>
+ , Reference>
{
typedef typename boost::pointer_to_other
@@ -187,11 +187,11 @@
public:
typedef std::random_access_iterator_tag iterator_category;
- typedef Value value_type;
+ typedef T value_type;
typedef typename std::iterator_traits
<Pointer>::difference_type difference_type;
typedef Pointer pointer;
- typedef Value & reference;
+ typedef Reference reference;
iterator()
{}
@@ -200,7 +200,7 @@
: pn(pn)
{}
- iterator(const iterator<T, T, typename boost::pointer_to_other<Pointer, T>::type >& x)
+ iterator(const iterator<T, T&, typename boost::pointer_to_other<Pointer, T>::type >& x)
: pn(x.pn)
{}
@@ -217,7 +217,7 @@
return void_ptr_ptr(static_cast<void_ptr*>(stable_vector_detail::get_pointer(p)));
}
- Value& dereference() const
+ reference dereference() const
{ return pn->value; }
bool equal(const iterator& x) const
{ return pn==x.pn; }
@@ -374,6 +374,9 @@
template<typename T, typename Allocator>
class stable_vector
{
+ ///@cond
+ typedef typename containers_detail::
+ move_const_ref_type<T>::type insert_const_ref_type;
typedef typename Allocator::template
rebind<void>::other::pointer void_ptr;
typedef typename Allocator::template
@@ -428,8 +431,10 @@
{ get_al().deallocate_one(p); }
friend class stable_vector_detail::clear_on_destroy<stable_vector>;
-
+ ///@endcond
public:
+
+
// types:
typedef typename Allocator::reference reference;
@@ -437,9 +442,9 @@
typedef typename Allocator::pointer pointer;
typedef typename Allocator::const_pointer const_pointer;
typedef stable_vector_detail::iterator
- <T,T, pointer> iterator;
+ <T,T&, pointer> iterator;
typedef stable_vector_detail::iterator
- <T,const T, const_pointer> const_iterator;
+ <T,const T&, const_pointer> const_iterator;
typedef typename impl_type::size_type size_type;
typedef typename iterator::difference_type difference_type;
typedef T value_type;
@@ -447,15 +452,16 @@
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ ///@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
< node_allocator_type
, alloc_version::value
>::type multiallocation_chain;
-
+ ///@endcond
public:
// construct/copy/destroy:
@@ -502,7 +508,7 @@
cod.release();
}
- stable_vector(BOOST_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); }
@@ -512,7 +518,7 @@
clear_pool();
}
- stable_vector& operator=(BOOST_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) {
@@ -521,7 +527,7 @@
return *this;
}
- stable_vector& operator=(BOOST_RV_REF(stable_vector) x)
+ stable_vector& operator=(BOOST_MOVE_MACRO_RV_REF(stable_vector) x)
{
if (&x != this){
this->swap(x);
@@ -663,25 +669,38 @@
// modifiers:
- void push_back(const T& t)
- { this->insert(end(), t); }
+ void push_back(insert_const_ref_type x)
+ { return priv_push_back(x); }
- void push_back(BOOST_RV_REF(T) t)
- { this->insert(end(), boost::move(t)); }
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return priv_push_back(u); }
+ #endif
+
+ 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); }
- iterator insert(const_iterator position, const T& t)
- {
- typedef constant_iterator<value_type, difference_type> cvalue_iterator;
- return this->insert_iter(position, cvalue_iterator(t, 1), cvalue_iterator(), std::forward_iterator_tag());
- }
+ iterator insert(const_iterator position, insert_const_ref_type x)
+ { return this->priv_insert(position, x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return this->priv_insert(position, u); }
+ #endif
- iterator insert(const_iterator position, BOOST_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::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
@@ -717,7 +736,7 @@
{
typedef emplace_functor<node_type_t, Args...> EmplaceFunctor;
typedef emplace_iterator<node_type_t, EmplaceFunctor> EmplaceIterator;
- EmplaceFunctor ef(boost::forward<Args>(args)...);
+ EmplaceFunctor &&ef = EmplaceFunctor(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
this->insert(this->cend(), EmplaceIterator(ef), EmplaceIterator());
}
@@ -737,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(boost::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);
}
@@ -816,6 +835,15 @@
/// @cond
private:
+ iterator priv_insert(const_iterator position, const value_type &t)
+ {
+ typedef constant_iterator<value_type, difference_type> cvalue_iterator;
+ return this->insert_iter(position, cvalue_iterator(t, 1), cvalue_iterator(), std::forward_iterator_tag());
+ }
+
+ void priv_push_back(const value_type &t)
+ { this->insert(end(), t); }
+
void clear_pool(allocator_v1)
{
if(!impl.empty() && impl.back()){
@@ -842,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::move(holder));
+ get_al().deallocate_individual(BOOST_CONTAINER_MOVE_NAMESPACE::move(holder));
p1 = p2 = 0;
this->internal_data.pool_size = 0;
}
@@ -872,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::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;
@@ -1141,7 +1169,7 @@
}
catch(...){
get_al().deallocate_one(p);
- get_al().deallocate_many(boost::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;
@@ -1177,9 +1205,9 @@
}
template <class InputIterator>
- void insert_iter(const_iterator position,InputIterator first,InputIterator last, boost::mpl::false_)
+ void insert_iter(const_iterator position, InputIterator first, InputIterator last, boost::mpl::false_)
{
- this->insert_not_iter(position,first,last);
+ this->insert_not_iter(position, first, last);
}
static void swap_impl(stable_vector& x,stable_vector& y)
@@ -1296,6 +1324,6 @@
}}
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif //BOOST_CONTAINER_STABLE_VECTOR_HPP
Modified: sandbox/move/boost/container/string.hpp
==============================================================================
--- sandbox/move/boost/container/string.hpp (original)
+++ sandbox/move/boost/container/string.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 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/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
+#include "detail/config_begin.hpp"
+#include INCLUDE_BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
-#include <boost/container/detail/workaround.hpp>
-#include <boost/container/container_fwd.hpp>
-#include <boost/container/detail/utilities.hpp>
-#include <boost/container/detail/iterators.hpp>
-#include <boost/container/detail/algorithms.hpp>
-#include <boost/container/detail/version_type.hpp>
-#include <boost/container/detail/allocation_type.hpp>
-#include <boost/container/detail/mpl.hpp>
-#include <boost/move/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/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_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_RV_REF(basic_string_base) b)
+ basic_string_base(BOOST_MOVE_MACRO_RV_REF(basic_string_base) b)
: members_(b.members_)
{
init();
@@ -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_RV_REF(basic_string) s)
- : base_t(boost::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_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_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_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_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_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::move(mx);
+ return BOOST_CONTAINER_MOVE_NAMESPACE::move(mx);
}
template <class CharT, class Traits, class A> inline
-BOOST_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_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_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_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::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_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_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_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
-operator+(BOOST_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::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_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
-operator+( BOOST_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::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())) {
@@ -2314,7 +2297,7 @@
/// @cond
namespace boost {
-
+/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class C, class T, class A>
@@ -2322,11 +2305,11 @@
{
static const bool value = has_trivial_destructor<A>::value;
};
-
+*/
}
/// @endcond
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif // BOOST_CONTAINERS_STRING_HPP
Modified: sandbox/move/boost/container/vector.hpp
==============================================================================
--- sandbox/move/boost/container/vector.hpp (original)
+++ sandbox/move/boost/container/vector.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 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/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
-#include <boost/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/container/detail/version_type.hpp>
-#include <boost/container/detail/allocation_type.hpp>
-#include <boost/container/detail/utilities.hpp>
-#include <boost/container/detail/iterators.hpp>
-#include <boost/container/detail/algorithms.hpp>
-#include <boost/container/detail/destroyers.hpp>
-#include <boost/container/container_fwd.hpp>
-#include <boost/move/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/container/detail/mpl.hpp>
-#include <boost/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 {
@@ -91,10 +63,10 @@
,const typename std::iterator_traits<Pointer>::value_type &>
{
public:
- typedef const typename std::iterator_traits<Pointer>::value_type value_type;
+ typedef typename std::iterator_traits<Pointer>::value_type value_type;
typedef typename std::iterator_traits<Pointer>::difference_type difference_type;
typedef typename boost::pointer_to_other<Pointer, value_type>::type pointer;
- typedef value_type& reference;
+ typedef const value_type& reference;
/// @cond
protected:
@@ -241,8 +213,8 @@
typedef T value_type;
typedef A allocator_type;
static const bool trivial_dctr = boost::has_trivial_destructor<value_type>::value;
- static const bool trivial_dctr_after_move =
- boost::has_trivial_destructor_after_move<value_type>::value || trivial_dctr;
+ static const bool trivial_dctr_after_move = false;
+ //::boost::has_trivial_destructor_after_move<value_type>::value || trivial_dctr;
static const bool trivial_copy = has_trivial_copy<value_type>::value;
static const bool nothrow_copy = has_nothrow_copy<value_type>::value;
static const bool trivial_assign = has_trivial_assign<value_type>::value;
@@ -284,11 +256,6 @@
: members_(a)
{}
- //Constructor, does not throw
- vector_alloc_holder(const vector_alloc_holder<A> &h)
- : members_(h.alloc())
- {}
-
//Destructor
~vector_alloc_holder()
{
@@ -357,6 +324,12 @@
size_type m_capacity;
} members_;
+ A &alloc()
+ { return members_; }
+
+ const A &alloc() const
+ { return members_; }
+
protected:
void prot_deallocate()
{
@@ -384,12 +357,6 @@
this->destroy_n(containers_detail::get_pointer(this->members_.m_start), this->members_.m_size);
this->members_.m_size = 0;
}
-
- A &alloc()
- { return members_; }
-
- const A &alloc() const
- { return members_; }
};
} //namespace containers_detail {
@@ -408,6 +375,8 @@
/// @cond
typedef vector<T, A> self_t;
typedef containers_detail::vector_alloc_holder<A> base_t;
+ typedef typename containers_detail::
+ move_const_ref_type<T>::type insert_const_ref_type;
/// @endcond
public:
//! The type of object, T, stored in the vector
@@ -442,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;
@@ -452,7 +421,7 @@
typedef constant_iterator<T, difference_type> cvalue_iterator;
typedef repeat_iterator<T, difference_type> repeat_it;
- typedef boost::move_iterator<repeat_it> repeat_move_it;
+ typedef BOOST_CONTAINER_MOVE_NAMESPACE::move_iterator<repeat_it> repeat_move_it;
/// @endcond
public:
@@ -494,7 +463,7 @@
//!
//! <b>Complexity</b>: Linear to the elements x contains.
vector(const vector<T, A>& x)
- : base_t((base_t&)x)
+ : base_t(static_cast<const base_t&>(x).alloc())
{ *this = x; }
//! <b>Effects</b>: Move constructor. Moves mx's resources to *this.
@@ -502,8 +471,8 @@
//! <b>Throws</b>: If allocator_type's copy constructor throws.
//!
//! <b>Complexity</b>: Constant.
- vector(BOOST_RV_REF(vector) mx)
- : base_t(boost::move(mx))
+ vector(BOOST_MOVE_MACRO_RV_REF(vector) mx)
+ : base_t(static_cast<base_t&>(mx).alloc())
{ this->swap(mx); }
//! <b>Effects</b>: Constructs a vector that will use a copy of allocator a
@@ -811,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::move_iterator<T*>, T*>
- proxy(boost::make_move_iterator(dummy_it), boost::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
@@ -849,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_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);
@@ -864,8 +833,8 @@
//!
//! <b>Throws</b>: If allocator_type's copy constructor throws.
//!
- //! <b>Complexity</b>: Constant.
- vector& operator=(BOOST_RV_REF(vector) x)
+ //! <b>Complexity</b>: Linear.
+ vector& operator=(BOOST_MOVE_MACRO_RV_REF(vector) x)
{
if (&x != this){
this->swap(x);
@@ -903,17 +872,19 @@
//! T's copy constructor throws.
//!
//! <b>Complexity</b>: Amortized constant time.
- void push_back(const 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(x);
- ++this->members_.m_size;
- }
- else{
- this->insert(this->cend(), x);
- }
- }
+ void push_back(insert_const_ref_type x)
+ { return priv_push_back(x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value
+ >::type* =0)
+ { return priv_push_back(u); }
+ #endif
//! <b>Effects</b>: Constructs a new element in the end of the vector
//! and moves the resources of mx to this new element.
@@ -921,15 +892,15 @@
//! <b>Throws</b>: If memory allocation throws.
//!
//! <b>Complexity</b>: Amortized constant time.
- void push_back(BOOST_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::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::move(x));
+ this->insert(this->cend(), BOOST_CONTAINER_MOVE_NAMESPACE::move(x));
}
}
@@ -947,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::forward<Args>(args)...);
+ new((void*)(back_pos))value_type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
++this->members_.m_size;
}
else{
- containers_detail::advanced_insert_aux_emplace<T, T*, Args...> proxy
- (boost::forward<Args>(args)...);
+ typedef containers_detail::advanced_insert_aux_emplace<T, T*, Args...> type;
+ type &&proxy = type(BOOST_CONTAINER_MOVE_NAMESPACE::forward<Args>(args)...);
priv_range_insert(back_pos, 1, proxy);
}
}
@@ -971,8 +942,8 @@
{
//Just call more general insert(pos, size, value) and return iterator
size_type pos_n = position - cbegin();
- containers_detail::advanced_insert_aux_emplace<T, T*, Args...> proxy
- (boost::forward<Args>(args)...);
+ typedef containers_detail::advanced_insert_aux_emplace<T, T*, Args...> type;
+ 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);
}
@@ -1063,13 +1034,16 @@
//!
//! <b>Complexity</b>: If position is end(), amortized constant time
//! Linear time otherwise.
- iterator insert(const_iterator position, const T& x)
- {
- //Just call more general insert(pos, size, value) and return iterator
- size_type pos_n = position - cbegin();
- this->insert(position, (size_type)1, x);
- return iterator(this->members_.m_start + pos_n);
- }
+ iterator insert(const_iterator position, insert_const_ref_type x)
+ { return this->priv_insert(position, x); }
+
+ #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_CONTAINER_MOVE_NAMESPACE::is_movable<U>::value >::type* =0)
+ { return this->priv_insert(position, u); }
+ #endif
//! <b>Requires</b>: position must be a valid iterator of *this.
//!
@@ -1079,7 +1053,7 @@
//!
//! <b>Complexity</b>: If position is end(), amortized constant time
//! Linear time otherwise.
- iterator insert(const_iterator position, BOOST_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();
@@ -1138,7 +1112,7 @@
{
T *pos = containers_detail::get_pointer(position.get_ptr());
T *beg = containers_detail::get_pointer(this->members_.m_start);
- boost::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);
@@ -1154,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::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())
@@ -1213,8 +1187,6 @@
void clear()
{ this->prot_destroy_all(); }
- /// @cond
-
//! <b>Effects</b>: Tries to deallocate the excess of memory created
//! with previous allocations. The size of the vector is unchanged
//!
@@ -1224,7 +1196,29 @@
void shrink_to_fit()
{ priv_shrink_to_fit(alloc_version()); }
+ /// @cond
+
private:
+ iterator priv_insert(const_iterator position, const T &x)
+ {
+ //Just call more general insert(pos, size, value) and return iterator
+ size_type pos_n = position - cbegin();
+ this->insert(position, (size_type)1, x);
+ return iterator(this->members_.m_start + pos_n);
+ }
+
+ void priv_push_back(const 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(x);
+ ++this->members_.m_size;
+ }
+ else{
+ this->insert(this->cend(), x);
+ }
+ }
+
void priv_shrink_to_fit(allocator_v1)
{
if(this->members_.m_capacity){
@@ -1341,10 +1335,10 @@
if (elems_after > n){
//New elements can be just copied.
//Move to uninitialized memory last objects
- boost::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::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);
}
@@ -1354,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::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
@@ -1376,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::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);
}
@@ -1387,7 +1381,7 @@
//Initialize from the rest of the old buffer,
//starting from previous point
if(old_buffer){
- new_finish = boost::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
@@ -1428,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::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;
@@ -1446,7 +1440,7 @@
//|___________|__________|_________|________________________|
//
//Now initialize the rest of memory with the last old values
- boost::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;
@@ -1473,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::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::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;
@@ -1538,13 +1532,13 @@
//
//Copy the first part of old_begin to raw_mem
T *start_n = old_start + difference_type(s_before);
- boost::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::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);
@@ -1554,7 +1548,7 @@
interf.copy_all_to(next);
T* move_start = next + n;
//Now displace old_end elements
- T* move_end = boost::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;
@@ -1590,7 +1584,7 @@
//|___________|_____|_________|__________________________|
//
//First copy whole old_begin and part of new to raw_mem
- boost::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;
@@ -1609,7 +1603,7 @@
interf.copy_all_to(old_start);
T* move_start = old_start + (n-mid_n);
//Displace old_end
- T* move_end = boost::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;
@@ -1660,10 +1654,10 @@
//
//First copy the part of old_end raw_mem
T* finish_n = old_finish - difference_type(n_after);
- boost::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::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);
@@ -1686,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::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);
@@ -1699,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::move(value_type(*first)));
+ this->insert(pos, BOOST_CONTAINER_MOVE_NAMESPACE::move(value_type(*first)));
}
}
@@ -1770,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::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::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){
@@ -1807,7 +1801,7 @@
FwdIt mid = first;
std::advance(mid, first_count);
// iG std::uninitialized_copy(first, mid, containers_detail::get_pointer(ret.first));
- boost::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"
@@ -1845,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, val); }
template <class InIt>
void priv_assign_dispatch(InIt first, InIt last, containers_detail::false_)
@@ -1920,6 +1914,8 @@
namespace boost {
+/*
+
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class T, class A>
@@ -1928,11 +1924,13 @@
static const bool value = has_trivial_destructor<A>::value;
};
+*/
+
}
/// @endcond
-#include <boost/container/detail/config_end.hpp>
+#include INCLUDE_BOOST_CONTAINER_DETAIL_CONFIG_END_HPP
#endif // #ifndef BOOST_CONTAINERS_CONTAINERS_VECTOR_HPP
Modified: sandbox/move/boost/intrusive/avl_set.hpp
==============================================================================
--- sandbox/move/boost/intrusive/avl_set.hpp (original)
+++ sandbox/move/boost/intrusive/avl_set.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -74,6 +74,8 @@
typedef typename implementation_defined::const_node_ptr const_node_ptr;
typedef typename implementation_defined::node_algorithms node_algorithms;
+ static const bool constant_time_size = Config::constant_time_size;
+
/// @cond
private:
tree_type tree_;
@@ -1264,6 +1266,8 @@
typedef typename implementation_defined::const_node_ptr const_node_ptr;
typedef typename implementation_defined::node_algorithms node_algorithms;
+ static const bool constant_time_size = Config::constant_time_size;
+
/// @cond
private:
tree_type tree_;
Modified: sandbox/move/boost/intrusive/avl_set_hook.hpp
==============================================================================
--- sandbox/move/boost/intrusive/avl_set_hook.hpp (original)
+++ sandbox/move/boost/intrusive/avl_set_hook.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -96,6 +96,7 @@
::type
{
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
//!
@@ -221,6 +222,7 @@
::type
{
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
//!
Modified: sandbox/move/boost/intrusive/avltree.hpp
==============================================================================
--- sandbox/move/boost/intrusive/avltree.hpp (original)
+++ sandbox/move/boost/intrusive/avltree.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -113,7 +113,7 @@
<pointer, node>::type node_ptr;
typedef typename boost::pointer_to_other
<node_ptr, const node>::type const_node_ptr;
- typedef avltree_algorithms<node_traits> node_algorithms;
+ typedef avltree_algorithms<node_traits> node_algorithms;
static const bool constant_time_size = Config::constant_time_size;
static const bool stateful_value_traits = detail::store_cont_ptr_on_it<avltree_impl>::value;
@@ -167,7 +167,7 @@
static node_ptr uncast(const_node_ptr ptr)
{
- return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
+ return node_ptr(const_cast<node*>(detail::boost_intrusive_get_pointer(ptr)));
}
size_traits &priv_size_traits()
@@ -1398,7 +1398,7 @@
static avltree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
{
header_plus_size *r = detail::parent_from_member<header_plus_size, node>
- ( detail::get_pointer(end_iterator.pointed_node()), &header_plus_size::header_);
+ ( detail::boost_intrusive_get_pointer(end_iterator.pointed_node()), &header_plus_size::header_);
node_plus_pred_t *n = detail::parent_from_member
<node_plus_pred_t, header_plus_size>(r, &node_plus_pred_t::header_plus_size_);
data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_);
Modified: sandbox/move/boost/intrusive/avltree_algorithms.hpp
==============================================================================
--- sandbox/move/boost/intrusive/avltree_algorithms.hpp (original)
+++ sandbox/move/boost/intrusive/avltree_algorithms.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -104,7 +104,7 @@
static node_ptr uncast(const_node_ptr ptr)
{
- return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer(ptr)));
+ return node_ptr(const_cast<node*>(::boost::intrusive::detail::boost_intrusive_get_pointer(ptr)));
}
/// @endcond
Modified: sandbox/move/boost/intrusive/bs_set_hook.hpp
==============================================================================
--- sandbox/move/boost/intrusive/bs_set_hook.hpp (original)
+++ sandbox/move/boost/intrusive/bs_set_hook.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -96,6 +96,7 @@
{
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
//!
@@ -220,6 +221,7 @@
::type
{
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
//!
Modified: sandbox/move/boost/intrusive/circular_list_algorithms.hpp
==============================================================================
--- sandbox/move/boost/intrusive/circular_list_algorithms.hpp (original)
+++ sandbox/move/boost/intrusive/circular_list_algorithms.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -110,7 +110,7 @@
//! <b>Effects</b>: Returns the number of nodes in a circular list. If the circular list
//! is empty, returns 1.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Linear
//!
//! <b>Throws</b>: Nothing.
static std::size_t count(const_node_ptr this_node)
Modified: sandbox/move/boost/intrusive/circular_slist_algorithms.hpp
==============================================================================
--- sandbox/move/boost/intrusive/circular_slist_algorithms.hpp (original)
+++ sandbox/move/boost/intrusive/circular_slist_algorithms.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -199,7 +199,7 @@
//! <b>Effects</b>: Returns the number of nodes in a circular list. If the circular list
//! is empty, returns 1.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Linear
//!
//! <b>Throws</b>: Nothing.
static std::size_t count(const_node_ptr this_node)
Modified: sandbox/move/boost/intrusive/derivation_value_traits.hpp
==============================================================================
--- sandbox/move/boost/intrusive/derivation_value_traits.hpp (original)
+++ sandbox/move/boost/intrusive/derivation_value_traits.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -14,6 +14,7 @@
#define BOOST_INTRUSIVE_DERIVATION_VALUE_TRAITS_HPP
#include <boost/intrusive/link_mode.hpp>
+#include <boost/pointer_cast.hpp>
#include <iterator>
namespace boost {
@@ -44,10 +45,16 @@
{ return node_ptr(&value); }
static pointer to_value_ptr(node_ptr n)
- { return pointer(static_cast<T*>(detail::get_pointer(n))); }
+ {
+ using ::boost::static_pointer_cast;
+ return static_pointer_cast<value_type>(n));
+ }
static const_pointer to_value_ptr(const_node_ptr n)
- { return const_pointer(static_cast<T*>(detail::get_pointer(n))); }
+ {
+ using ::boost::static_pointer_cast;
+ return static_pointer_cast<const value_type>(n));
+ }
};
} //namespace intrusive
Modified: sandbox/move/boost/intrusive/detail/any_node_and_algorithms.hpp
==============================================================================
--- sandbox/move/boost/intrusive/detail/any_node_and_algorithms.hpp (original)
+++ sandbox/move/boost/intrusive/detail/any_node_and_algorithms.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -19,6 +19,7 @@
#include <boost/intrusive/detail/pointer_to_other.hpp>
#include <cstddef>
#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/pointer_cast.hpp>
namespace boost {
namespace intrusive {
@@ -87,7 +88,10 @@
static const bool optimize_multikey = true;
static node_ptr get_next(const_node_ptr n)
- { return node_ptr(&static_cast<node &>(*n->node_ptr_1)); }
+ {
+ using ::boost::static_pointer_cast;
+ return static_pointer_cast<node>(n->node_ptr_1);
+ }
static void set_next(node_ptr n, node_ptr next)
{ n->node_ptr_1 = next; }
Modified: sandbox/move/boost/intrusive/detail/hashtable_node.hpp
==============================================================================
--- sandbox/move/boost/intrusive/detail/hashtable_node.hpp (original)
+++ sandbox/move/boost/intrusive/detail/hashtable_node.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -22,7 +22,7 @@
#include <boost/intrusive/detail/utilities.hpp>
#include <boost/intrusive/detail/slist_node.hpp> //remove-me
#include <cstddef>
-
+#include <boost/pointer_cast.hpp>
namespace boost {
namespace intrusive {
namespace detail {
@@ -36,6 +36,7 @@
template<int Dummy>
const std::size_t prime_list_holder<Dummy>::prime_list[] = {
+ 3ul, 7ul, 11ul, 17ul, 29ul,
53ul, 97ul, 193ul, 389ul, 769ul,
1543ul, 3079ul, 6151ul, 12289ul, 24593ul,
49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
@@ -100,8 +101,12 @@
class hashtable_iterator
: public std::iterator
< std::forward_iterator_tag
+ , typename Container::value_type
+ , typename std::iterator_traits<typename Container::value_type*>::difference_type
+ , typename detail::add_const_if_c
+ <typename Container::value_type, IsConst>::type *
, typename detail::add_const_if_c
- <typename Container::value_type, IsConst>::type
+ <typename Container::value_type, IsConst>::type &
>
{
typedef typename Container::real_value_traits real_value_traits;
@@ -113,11 +118,17 @@
typedef typename Container::size_type size_type;
static typename Container::node_ptr downcast_bucket(typename bucket_type::node_ptr p)
- { return typename Container::node_ptr(&static_cast<typename Container::node&>(*p)); }
+ {
+ using ::boost::static_pointer_cast;
+ return static_pointer_cast<typename Container::node>(p);
+ }
public:
+ typedef typename Container::value_type value_type;
+ typedef typename detail::add_const_if_c
+ <typename Container::value_type, IsConst>::type *pointer;
typedef typename detail::add_const_if_c
- <typename Container::value_type, IsConst>::type value_type;
+ <typename Container::value_type, IsConst>::type &reference;
hashtable_iterator ()
{}
@@ -153,14 +164,14 @@
friend bool operator!= (const hashtable_iterator& i, const hashtable_iterator& i2)
{ return !(i == i2); }
- value_type& operator*() const
+ reference operator*() const
{ return *this->operator ->(); }
- value_type* operator->() const
- { return detail::get_pointer(this->get_real_value_traits()->to_value_ptr(downcast_bucket(slist_it_.pointed_node()))); }
+ pointer operator->() const
+ { return detail::boost_intrusive_get_pointer(this->get_real_value_traits()->to_value_ptr(downcast_bucket(slist_it_.pointed_node()))); }
const Container *get_container() const
- { return detail::get_pointer(cont_); }
+ { return detail::boost_intrusive_get_pointer(cont_); }
const real_value_traits *get_real_value_traits() const
{ return &this->get_container()->get_real_value_traits(); }
@@ -168,8 +179,8 @@
private:
void increment()
{
- const Container *cont = detail::get_pointer(cont_);
- bucket_type* buckets = detail::get_pointer(cont->bucket_pointer());
+ const Container *cont = detail::boost_intrusive_get_pointer(cont_);
+ bucket_type* buckets = detail::boost_intrusive_get_pointer(cont->bucket_pointer());
size_type buckets_len = cont->bucket_count();
++slist_it_;
Modified: sandbox/move/boost/intrusive/detail/is_stateful_value_traits.hpp
==============================================================================
--- sandbox/move/boost/intrusive/detail/is_stateful_value_traits.hpp (original)
+++ sandbox/move/boost/intrusive/detail/is_stateful_value_traits.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -14,6 +14,25 @@
#define BOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP
#include <boost/intrusive/detail/config_begin.hpp>
+
+#if defined(_MSC_VER) && (_MSC_VER <= 1310)
+
+#include <boost/intrusive/detail/mpl.hpp>
+
+namespace boost {
+namespace intrusive {
+namespace detail {
+
+template<class ValueTraits>
+struct is_stateful_value_traits
+{
+ static const bool value = !detail::is_empty_class<ValueTraits>::value;
+};
+
+}}}
+
+#else
+
#include <boost/intrusive/detail/function_detector.hpp>
BOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(to_node_ptr, boost_intrusive)
@@ -51,6 +70,8 @@
}}}
+#endif
+
#include <boost/intrusive/detail/config_end.hpp>
#endif //@ifndef BOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP
Modified: sandbox/move/boost/intrusive/detail/list_node.hpp
==============================================================================
--- sandbox/move/boost/intrusive/detail/list_node.hpp (original)
+++ sandbox/move/boost/intrusive/detail/list_node.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -63,8 +63,10 @@
class list_iterator
: public std::iterator
< std::bidirectional_iterator_tag
- , typename detail::add_const_if_c
- <typename Container::value_type, IsConst>::type
+ , typename Container::value_type
+ , typename Container::difference_type
+ , typename detail::if_c<IsConst,typename Container::const_pointer,typename Container::pointer>::type
+ , typename detail::if_c<IsConst,typename Container::const_reference,typename Container::reference>::type
>
{
protected:
@@ -78,11 +80,9 @@
detail::store_cont_ptr_on_it<Container>::value;
public:
- typedef typename detail::add_const_if_c
- <typename Container::value_type, IsConst>
- ::type value_type;
- typedef value_type & reference;
- typedef value_type * pointer;
+ typedef typename Container::value_type value_type;
+ typedef typename detail::if_c<IsConst,typename Container::const_pointer,typename Container::pointer>::type pointer;
+ typedef typename detail::if_c<IsConst,typename Container::const_reference,typename Container::reference>::type reference;
list_iterator()
: members_ (node_ptr(0), 0)
@@ -129,17 +129,17 @@
return result;
}
- bool operator== (const list_iterator& i) const
- { return members_.nodeptr_ == i.pointed_node(); }
+ friend bool operator== (const list_iterator& l, const list_iterator& r)
+ { return l.pointed_node() == r.pointed_node(); }
- bool operator!= (const list_iterator& i) const
- { return !operator== (i); }
+ friend bool operator!= (const list_iterator& l, const list_iterator& r)
+ { return !(l == r); }
- value_type& operator*() const
+ reference operator*() const
{ return *operator->(); }
pointer operator->() const
- { return detail::get_pointer(this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); }
+ { return detail::boost_intrusive_get_pointer(this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); }
const Container *get_container() const
{
Modified: sandbox/move/boost/intrusive/detail/slist_node.hpp
==============================================================================
--- sandbox/move/boost/intrusive/detail/slist_node.hpp (original)
+++ sandbox/move/boost/intrusive/detail/slist_node.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -55,8 +55,10 @@
class slist_iterator
: public std::iterator
< std::forward_iterator_tag
- , typename detail::add_const_if_c
- <typename Container::value_type, IsConst>::type
+ , typename Container::value_type
+ , typename Container::difference_type
+ , typename detail::if_c<IsConst,typename Container::const_pointer,typename Container::pointer>::type
+ , typename detail::if_c<IsConst,typename Container::const_reference,typename Container::reference>::type
>
{
protected:
@@ -70,11 +72,9 @@
detail::store_cont_ptr_on_it<Container>::value;
public:
- typedef typename detail::add_const_if_c
- <typename Container::value_type, IsConst>
- ::type value_type;
- typedef value_type & reference;
- typedef value_type * pointer;
+ typedef typename Container::value_type value_type;
+ typedef typename detail::if_c<IsConst,typename Container::const_pointer,typename Container::pointer>::type pointer;
+ typedef typename detail::if_c<IsConst,typename Container::const_reference,typename Container::reference>::type reference;
slist_iterator()
: members_ (node_ptr(0), 0)
@@ -108,17 +108,17 @@
return result;
}
- bool operator== (const slist_iterator& i) const
- { return members_.nodeptr_ == i.pointed_node(); }
+ friend bool operator== (const slist_iterator& l, const slist_iterator& r)
+ { return l.pointed_node() == r.pointed_node(); }
- bool operator!= (const slist_iterator& i) const
- { return !operator== (i); }
+ friend bool operator!= (const slist_iterator& l, const slist_iterator& r)
+ { return !(l == r); }
- value_type& operator*() const
+ reference operator*() const
{ return *operator->(); }
pointer operator->() const
- { return detail::get_pointer(this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); }
+ { return detail::boost_intrusive_get_pointer(this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); }
const Container *get_container() const
{
Modified: sandbox/move/boost/intrusive/detail/tree_algorithms.hpp
==============================================================================
--- sandbox/move/boost/intrusive/detail/tree_algorithms.hpp (original)
+++ sandbox/move/boost/intrusive/detail/tree_algorithms.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -18,6 +18,7 @@
#include <boost/intrusive/intrusive_fwd.hpp>
#include <cstddef>
#include <boost/intrusive/detail/utilities.hpp>
+//iG pending #include <boost/pointer_cast.hpp>
namespace boost {
namespace intrusive {
@@ -140,7 +141,8 @@
static node_ptr uncast(const_node_ptr ptr)
{
- return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer(ptr)));
+ return node_ptr(const_cast<node*>(::boost::intrusive::detail::boost_intrusive_get_pointer(ptr)));
+ //iG pending return node_ptr(boost::const_pointer_cast<node>(ptr));
}
/// @endcond
@@ -1499,7 +1501,7 @@
static node_ptr vine_to_subtree(node_ptr old_root, std::size_t count)
{
- std::size_t leaf_nodes = count + 1 - ((size_t) 1 << floor_log2 (count + 1));
+ std::size_t leaf_nodes = count + 1 - ((std::size_t) 1 << floor_log2 (count + 1));
std::size_t vine_nodes = count - leaf_nodes;
node_ptr new_root = compress_subtree(old_root, leaf_nodes);
Modified: sandbox/move/boost/intrusive/detail/tree_node.hpp
==============================================================================
--- sandbox/move/boost/intrusive/detail/tree_node.hpp (original)
+++ sandbox/move/boost/intrusive/detail/tree_node.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -72,8 +72,10 @@
class tree_iterator
: public std::iterator
< std::bidirectional_iterator_tag
- , typename detail::add_const_if_c
- <typename Container::value_type, IsConst>::type
+ , typename Container::value_type
+ , typename Container::difference_type
+ , typename detail::if_c<IsConst,typename Container::const_pointer,typename Container::pointer>::type
+ , typename detail::if_c<IsConst,typename Container::const_reference,typename Container::reference>::type
>
{
protected:
@@ -88,12 +90,10 @@
detail::store_cont_ptr_on_it<Container>::value;
public:
- public:
- typedef typename detail::add_const_if_c
- <typename Container::value_type, IsConst>
- ::type value_type;
- typedef value_type & reference;
- typedef value_type * pointer;
+ typedef typename Container::value_type value_type;
+ typedef typename detail::if_c<IsConst,typename Container::const_pointer,typename Container::pointer>::type pointer;
+ typedef typename detail::if_c<IsConst,typename Container::const_reference,typename Container::reference>::type reference;
+
tree_iterator()
: members_ (0, 0)
@@ -140,17 +140,17 @@
return result;
}
- bool operator== (const tree_iterator& i) const
- { return members_.nodeptr_ == i.pointed_node(); }
+ friend bool operator== (const tree_iterator& l, const tree_iterator& r)
+ { return l.pointed_node() == r.pointed_node(); }
- bool operator!= (const tree_iterator& i) const
- { return !operator== (i); }
+ friend bool operator!= (const tree_iterator& l, const tree_iterator& r)
+ { return !(l == r); }
- value_type& operator*() const
+ reference operator*() const
{ return *operator->(); }
pointer operator->() const
- { return detail::get_pointer(this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); }
+ { return detail::boost_intrusive_get_pointer(this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); }
const Container *get_container() const
{ return static_cast<const Container*>(members_.get_ptr()); }
Modified: sandbox/move/boost/intrusive/detail/utilities.hpp
==============================================================================
--- sandbox/move/boost/intrusive/detail/utilities.hpp (original)
+++ sandbox/move/boost/intrusive/detail/utilities.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -46,8 +46,7 @@
template<bool Add>
struct two_or_three {one _[2 + Add];};
template <class U> static one test(...);
- template <class U> static two_or_three<U::boost_intrusive_tags::is_base_hook>
- test (detail::bool_<U::boost_intrusive_tags::is_base_hook>* = 0);
+ template <class U> static two_or_three<U::boost_intrusive_tags::is_base_hook> test (int);
static const std::size_t value = sizeof(test<T>(0));
};
@@ -63,8 +62,7 @@
template<bool Add>
struct two_or_three {one _[2 + Add];};
template <class U> static one test(...);
- template <class U> static two_or_three<U::is_any_hook>
- test (detail::bool_<U::is_any_hook>* = 0);
+ template <class U> static two_or_three<U::is_any_hook> test (int);
static const std::size_t value = sizeof(test<T>(0));
};
@@ -81,8 +79,7 @@
template<bool Add>
struct two_or_three {one _[2 + Add];};
template <class U> static one test(...);
- template <class U> static two_or_three<U::external_value_traits>
- test (detail::bool_<U::external_value_traits>* = 0);
+ template <class U> static two_or_three<U::external_value_traits> test (int);
static const std::size_t value = sizeof(test<T>(0));
};
@@ -92,8 +89,7 @@
template<bool Add>
struct two_or_three {one _[2 + Add];};
template <class U> static one test(...);
- template <class U> static two_or_three<U::external_bucket_traits>
- test (detail::bool_<U::external_bucket_traits>* = 0);
+ template <class U> static two_or_three<U::external_bucket_traits> test (int);
static const std::size_t value = sizeof(test<T>(0));
};
@@ -126,10 +122,10 @@
{ return ptr;}
};
-//!Overload for smart pointers to avoid ADL problems with get_pointer
+//!Overload for smart pointers to avoid ADL problems with boost_intrusive_get_pointer
template<class Ptr>
inline typename smart_ptr_type<Ptr>::pointer
-get_pointer(const Ptr &ptr)
+boost_intrusive_get_pointer(const Ptr &ptr)
{ return smart_ptr_type<Ptr>::get(ptr); }
//This functor compares a stored value
@@ -323,7 +319,7 @@
{}
const void *get_ptr() const
- { return detail::get_pointer(const_void_ptr_); }
+ { return detail::boost_intrusive_get_pointer(const_void_ptr_); }
ConstVoidPtr const_void_ptr_;
};
@@ -426,13 +422,13 @@
static pointer to_value_ptr(node_ptr n)
{
return detail::parent_from_member<T, Hook>
- (static_cast<Hook*>(detail::get_pointer(n)), P);
+ (static_cast<Hook*>(detail::boost_intrusive_get_pointer(n)), P);
}
static const_pointer to_value_ptr(const_node_ptr n)
{
return detail::parent_from_member<T, Hook>
- (static_cast<const Hook*>(detail::get_pointer(n)), P);
+ (static_cast<const Hook*>(detail::boost_intrusive_get_pointer(n)), P);
}
};
@@ -564,13 +560,24 @@
}
};
+template<class ValueTraits, bool ExternalValueTraits>
+struct store_cont_ptr_on_it_impl
+{
+ static const bool value = is_stateful_value_traits<ValueTraits>::value;
+};
+
+template<class ValueTraits>
+struct store_cont_ptr_on_it_impl<ValueTraits, true>
+{
+ static const bool value = true;
+};
+
template <class Container>
struct store_cont_ptr_on_it
{
typedef typename Container::value_traits value_traits;
- static const bool value = is_stateful_value_traits<value_traits>::value
- || external_value_traits_is_true<value_traits>::value
- ;
+ static const bool value = store_cont_ptr_on_it_impl
+ <value_traits, external_value_traits_is_true<value_traits>::value>::value;
};
template<class Container, bool IsConst>
@@ -625,6 +632,64 @@
{ return *(this->get_real_value_traits()->to_value_ptr(npointer(&arg))); }
};
+//This is not standard, but should work with all compilers
+union max_align
+{
+ char char_;
+ short short_;
+ int int_;
+ long long_;
+ #ifdef BOOST_HAS_LONG_LONG
+ long long long_long_;
+ #endif
+ float float_;
+ double double_;
+ long double long_double_;
+ void * void_ptr_;
+};
+
+template<class T, std::size_t N>
+class array_initializer
+{
+ public:
+ template<class CommonInitializer>
+ array_initializer(const CommonInitializer &init)
+ {
+ char *init_buf = (char*)rawbuf;
+ std::size_t i = 0;
+ try{
+ for(; i != N; ++i){
+ new(init_buf)T(init);
+ init_buf += sizeof(T);
+ }
+ }
+ catch(...){
+ while(i--){
+ init_buf -= sizeof(T);
+ ((T*)init_buf)->~T();
+ }
+ throw;
+ }
+ }
+
+ operator T* ()
+ { return (T*)(rawbuf); }
+
+ operator const T*() const
+ { return (const T*)(rawbuf); }
+
+ ~array_initializer()
+ {
+ char *init_buf = (char*)rawbuf + N*sizeof(T);
+ for(std::size_t i = 0; i != N; ++i){
+ init_buf -= sizeof(T);
+ ((T*)init_buf)->~T();
+ }
+ }
+
+ private:
+ detail::max_align rawbuf[(N*sizeof(T)-1)/sizeof(detail::max_align)+1];
+};
} //namespace detail
} //namespace intrusive
Modified: sandbox/move/boost/intrusive/hashtable.hpp
==============================================================================
--- sandbox/move/boost/intrusive/hashtable.hpp (original)
+++ sandbox/move/boost/intrusive/hashtable.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -23,6 +23,7 @@
#include <boost/intrusive/detail/assert.hpp>
#include <boost/static_assert.hpp>
#include <boost/functional/hash.hpp>
+#include <boost/pointer_cast.hpp>
//General intrusive utilities
#include <boost/intrusive/intrusive_fwd.hpp>
#include <boost/intrusive/detail/pointer_to_other.hpp>
@@ -186,8 +187,7 @@
template<bool Add>
struct two_or_three {one _[2 + Add];};
template <class U> static one test(...);
- template <class U> static two_or_three<U::store_hash>
- test (detail::bool_<U::store_hash>* = 0);
+ template <class U> static two_or_three<U::store_hash> test (int);
static const std::size_t value = sizeof(test<T>(0));
};
@@ -203,8 +203,7 @@
template<bool Add>
struct two_or_three {one _[2 + Add];};
template <class U> static one test(...);
- template <class U> static two_or_three<U::optimize_multikey>
- test (detail::bool_<U::optimize_multikey>* = 0);
+ template <class U> static two_or_three<U::optimize_multikey> test (int);
static const std::size_t value = sizeof(test<T>(0));
};
@@ -331,7 +330,10 @@
typedef circular_slist_algorithms<group_traits> group_algorithms;
static node_ptr dcast_bucket_ptr(slist_node_ptr p)
- { return node_ptr(&static_cast<node&>(*p)); }
+ {
+ using ::boost::static_pointer_cast;
+ return static_pointer_cast<node>(p);
+ }
static slist_node_ptr priv_get_bucket_before_begin
(slist_node_ptr bucket_beg, slist_node_ptr bucket_end, node_ptr p)
@@ -603,7 +605,7 @@
typedef typename real_value_traits::pointer pointer;
typedef typename real_value_traits::const_pointer const_pointer;
- typedef typename std::iterator_traits<pointer>::value_type value_type;
+ typedef typename real_value_traits::value_type value_type;
typedef typename std::iterator_traits<pointer>::reference reference;
typedef typename std::iterator_traits<const_pointer>::reference const_reference;
typedef typename std::iterator_traits<pointer>::difference_type difference_type;
@@ -888,7 +890,7 @@
}
else{
size_type buckets_len = this->priv_buckets_len();
- const bucket_type *b = detail::get_pointer(this->priv_buckets());
+ const bucket_type *b = detail::boost_intrusive_get_pointer(this->priv_buckets());
for (size_type n = 0; n < buckets_len; ++n, ++b){
if(!b->empty()){
return false;
@@ -911,7 +913,7 @@
else{
size_type len = 0;
size_type buckets_len = this->priv_buckets_len();
- const bucket_type *b = detail::get_pointer(this->priv_buckets());
+ const bucket_type *b = detail::boost_intrusive_get_pointer(this->priv_buckets());
for (size_type n = 0; n < buckets_len; ++n, ++b){
len += b->size();
}
@@ -1231,8 +1233,8 @@
//!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased element. No destructors are called.
- iterator erase(const_iterator i)
- { return this->erase_and_dispose(i, detail::null_disposer()); }
+ void erase(const_iterator i)
+ { this->erase_and_dispose(i, detail::null_disposer()); }
//! <b>Effects</b>: Erases the range pointed to by b end e.
//!
@@ -1243,8 +1245,8 @@
//!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
- iterator erase(const_iterator b, const_iterator e)
- { return this->erase_and_dispose(b, e, detail::null_disposer()); }
+ void erase(const_iterator b, const_iterator e)
+ { this->erase_and_dispose(b, e, detail::null_disposer()); }
//! <b>Effects</b>: Erases all the elements with the given value.
//!
@@ -1297,18 +1299,15 @@
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
- iterator erase_and_dispose(const_iterator i, Disposer disposer
+ void erase_and_dispose(const_iterator i, Disposer disposer
/// @cond
, typename detail::enable_if_c<!detail::is_convertible<Disposer, const_iterator>::value >::type * = 0
/// @endcond
)
{
- iterator ret(i.unconst());
- ++ret;
priv_erase(i, disposer, optimize_multikey_t());
this->priv_size_traits().decrement();
priv_erasure_update_cache();
- return ret;
}
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
@@ -1324,7 +1323,7 @@
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
- iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ void erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
{
if(b != e){
//Get the bucket number and local iterator for both iterators
@@ -1349,7 +1348,6 @@
priv_erase_range(before_first_local_it, first_bucket_num, last_local_it, last_bucket_num, disposer);
priv_erasure_update_cache(first_bucket_num, last_bucket_num);
}
- return e.unconst();
}
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
@@ -2141,8 +2139,8 @@
}
//! <b>Effects</b>: Returns the nearest new bucket count optimized for
- //! the container that is bigger than n. This suggestion can be used
- //! to create bucket arrays with a size that will usually improve
+ //! the container that is bigger or equal than n. This suggestion can be
+ //! used to create bucket arrays with a size that will usually improve
//! container's performance. If such value does not exist, the
//! higher possible value is returned.
//!
@@ -2155,15 +2153,15 @@
const std::size_t *primes_end = primes + detail::prime_list_holder<0>::prime_list_size;
size_type const* bound = std::lower_bound(primes, primes_end, n);
if(bound == primes_end)
- bound--;
+ --bound;
return size_type(*bound);
}
//! <b>Effects</b>: Returns the nearest new bucket count optimized for
- //! the container that is smaller than n. This suggestion can be used
- //! to create bucket arrays with a size that will usually improve
+ //! the container that is smaller or equal than n. This suggestion can be
+ //! used to create bucket arrays with a size that will usually improve
//! container's performance. If such value does not exist, the
- //! lower possible value is returned.
+ //! lowest possible value is returned.
//!
//! <b>Complexity</b>: Amortized constant time.
//!
@@ -2173,8 +2171,8 @@
const std::size_t *primes = &detail::prime_list_holder<0>::prime_list[0];
const std::size_t *primes_end = primes + detail::prime_list_holder<0>::prime_list_size;
size_type const* bound = std::upper_bound(primes, primes_end, n);
- if(bound != primes_end)
- bound--;
+ if(bound != primes)
+ --bound;
return size_type(*bound);
}
@@ -2242,7 +2240,7 @@
{ return this->priv_real_bucket_traits().bucket_count(); }
static node_ptr uncast(const_node_ptr ptr)
- { return node_ptr(const_cast<node*>(detail::get_pointer(ptr))); }
+ { return node_ptr(const_cast<node*>(detail::boost_intrusive_get_pointer(ptr))); }
node &priv_value_to_node(value_type &v)
{ return *this->get_real_value_traits().to_node_ptr(v); }
@@ -2328,7 +2326,10 @@
}
static node_ptr dcast_bucket_ptr(typename slist_impl::node_ptr p)
- { return node_ptr(&static_cast<node&>(*p)); }
+ {
+ using ::boost::static_pointer_cast;
+ return static_pointer_cast<node>(p);
+ }
std::size_t priv_stored_or_compute_hash(const value_type &v, detail::true_) const
{ return node_traits::get_hash(this->get_real_value_traits().to_node_ptr(v)); }
Modified: sandbox/move/boost/intrusive/linear_slist_algorithms.hpp
==============================================================================
--- sandbox/move/boost/intrusive/linear_slist_algorithms.hpp (original)
+++ sandbox/move/boost/intrusive/linear_slist_algorithms.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -156,7 +156,7 @@
//! <b>Effects</b>: Returns the number of nodes in a linear list. If the linear list
//! is empty, returns 1.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Linear
//!
//! <b>Throws</b>: Nothing.
static std::size_t count(const_node_ptr this_node)
Modified: sandbox/move/boost/intrusive/list.hpp
==============================================================================
--- sandbox/move/boost/intrusive/list.hpp (original)
+++ sandbox/move/boost/intrusive/list.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -30,6 +30,7 @@
#include <algorithm>
#include <functional>
#include <cstddef>
+//iG pending #include <boost/pointer_cast.hpp>
namespace boost {
namespace intrusive {
@@ -107,7 +108,6 @@
static const bool constant_time_size = Config::constant_time_size;
static const bool stateful_value_traits = detail::is_stateful_value_traits<real_value_traits>::value;
- BOOST_STATIC_ASSERT(( stateful_value_traits == false ));
/// @cond
@@ -130,8 +130,8 @@
//Const cast emulation for smart pointers
static node_ptr uncast(const_node_ptr ptr)
{
- //return node_ptr(detail::get_pointer(ptr)));
- return const_cast<node*>(detail::get_pointer(ptr));
+ return const_cast<node*>(detail::boost_intrusive_get_pointer(ptr));
+ //iG pending return node_ptr(boost::const_pointer_cast<node>(ptr));
}
node_ptr get_root_node()
@@ -173,6 +173,22 @@
real_value_traits &get_real_value_traits(detail::bool_<true>)
{ return data_.get_value_traits(*this); }
+ const value_traits &get_value_traits() const
+ { return data_; }
+
+ value_traits &get_value_traits()
+ { return data_; }
+
+ protected:
+ node &prot_root_node()
+ { return data_.root_plus_size_.root_; }
+
+ node const &prot_root_node() const
+ { return data_.root_plus_size_.root_; }
+
+ void prot_set_size(size_type s)
+ { data_.root_plus_size_.set_size(s); }
+
/// @endcond
public:
@@ -972,8 +988,8 @@
{
if(node_traits::get_next(this->get_root_node())
!= node_traits::get_previous(this->get_root_node())){
- list_impl carry;
- list_impl counter[64];
+ list_impl carry(this->get_value_traits());
+ detail::array_initializer<list_impl, 64> counter(this->get_value_traits());
int fill = 0;
while(!this->empty()){
carry.splice(carry.cbegin(), *this, this->cbegin());
@@ -1269,7 +1285,7 @@
static list_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
{
root_plus_size *r = detail::parent_from_member<root_plus_size, node>
- ( detail::get_pointer(end_iterator.pointed_node()), &root_plus_size::root_);
+ ( detail::boost_intrusive_get_pointer(end_iterator.pointed_node()), &root_plus_size::root_);
data_t *d = detail::parent_from_member<data_t, root_plus_size>
( r, &data_t::root_plus_size_);
list_impl *s = detail::parent_from_member<list_impl, data_t>(d, &list_impl::data_);
Modified: sandbox/move/boost/intrusive/list_hook.hpp
==============================================================================
--- sandbox/move/boost/intrusive/list_hook.hpp (original)
+++ sandbox/move/boost/intrusive/list_hook.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -93,6 +93,7 @@
::type
{
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
//!
@@ -214,6 +215,7 @@
::type
{
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
//!
Modified: sandbox/move/boost/intrusive/member_value_traits.hpp
==============================================================================
--- sandbox/move/boost/intrusive/member_value_traits.hpp (original)
+++ sandbox/move/boost/intrusive/member_value_traits.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -49,13 +49,13 @@
static pointer to_value_ptr(node_ptr n)
{
return pointer(detail::parent_from_member<value_type, node>
- (detail::get_pointer(n), PtrToMember));
+ (detail::boost_intrusive_get_pointer(n), PtrToMember));
}
static const_pointer to_value_ptr(const_node_ptr n)
{
return pointer(detail::parent_from_member<value_type, node>
- (detail::get_pointer(n), PtrToMember));
+ (detail::boost_intrusive_get_pointer(n), PtrToMember));
}
};
Modified: sandbox/move/boost/intrusive/rbtree.hpp
==============================================================================
--- sandbox/move/boost/intrusive/rbtree.hpp (original)
+++ sandbox/move/boost/intrusive/rbtree.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -33,6 +33,7 @@
#include <boost/intrusive/options.hpp>
#include <boost/intrusive/rbtree_algorithms.hpp>
#include <boost/intrusive/link_mode.hpp>
+//iG pending #include <boost/pointer_cast.hpp>
namespace boost {
namespace intrusive {
@@ -110,10 +111,8 @@
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename real_value_traits::node_traits node_traits;
typedef typename node_traits::node node;
- typedef typename boost::pointer_to_other
- <pointer, node>::type node_ptr;
- typedef typename boost::pointer_to_other
- <node_ptr, const node>::type const_node_ptr;
+ typedef typename node_traits::node_ptr node_ptr;
+ typedef typename node_traits::const_node_ptr const_node_ptr;
typedef rbtree_algorithms<node_traits> node_algorithms;
static const bool constant_time_size = Config::constant_time_size;
@@ -152,7 +151,7 @@
{}
node_plus_pred_t node_plus_pred_;
} data_;
-
+
const value_compare &priv_comp() const
{ return data_.node_plus_pred_.get(); }
@@ -167,7 +166,8 @@
static node_ptr uncast(const_node_ptr ptr)
{
- return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
+ return node_ptr(const_cast<node*>(detail::boost_intrusive_get_pointer(ptr)));
+//iG pending return node_ptr(boost::const_pointer_cast<node>(ptr));
}
size_traits &priv_size_traits()
@@ -188,6 +188,19 @@
real_value_traits &get_real_value_traits(detail::bool_<true>)
{ return data_.get_value_traits(*this); }
+ protected:
+ value_compare &prot_comp()
+ { return priv_comp(); }
+
+ const node &prot_header_node() const
+ { return priv_header(); }
+
+ node &prot_header_node()
+ { return priv_header(); }
+
+ void prot_set_size(size_type s)
+ { this->priv_size_traits().set_size(s); }
+
/// @endcond
public:
@@ -1390,7 +1403,7 @@
static rbtree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
{
header_plus_size *r = detail::parent_from_member<header_plus_size, node>
- ( detail::get_pointer(end_iterator.pointed_node()), &header_plus_size::header_);
+ ( detail::boost_intrusive_get_pointer(end_iterator.pointed_node()), &header_plus_size::header_);
node_plus_pred_t *n = detail::parent_from_member
<node_plus_pred_t, header_plus_size>(r, &node_plus_pred_t::header_plus_size_);
data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_);
Modified: sandbox/move/boost/intrusive/rbtree_algorithms.hpp
==============================================================================
--- sandbox/move/boost/intrusive/rbtree_algorithms.hpp (original)
+++ sandbox/move/boost/intrusive/rbtree_algorithms.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -157,7 +157,7 @@
static node_ptr uncast(const_node_ptr ptr)
{
- return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer(ptr)));
+ return node_ptr(const_cast<node*>(::boost::intrusive::detail::boost_intrusive_get_pointer(ptr)));
}
/// @endcond
Modified: sandbox/move/boost/intrusive/set.hpp
==============================================================================
--- sandbox/move/boost/intrusive/set.hpp (original)
+++ sandbox/move/boost/intrusive/set.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -75,9 +75,19 @@
typedef typename implementation_defined::const_node_ptr const_node_ptr;
typedef typename implementation_defined::node_algorithms node_algorithms;
+ static const bool constant_time_size = Config::constant_time_size;
+ //static const bool stateful_value_traits = detail::is_stateful_value_traits<real_value_traits>::value;
+
/// @cond
private:
tree_type tree_;
+
+ protected:
+ node &prot_header_node(){ return tree_.prot_header_node(); }
+ node const &prot_header_node() const{ return tree_.prot_header_node(); }
+ void prot_set_size(size_type s){ tree_.prot_set_size(s); }
+ value_compare &prot_comp(){ return tree_.prot_comp(); }
+
/// @endcond
public:
@@ -1265,9 +1275,18 @@
typedef typename implementation_defined::const_node_ptr const_node_ptr;
typedef typename implementation_defined::node_algorithms node_algorithms;
+ static const bool constant_time_size = Config::constant_time_size;
+ //static const bool stateful_value_traits = detail::is_stateful_value_traits<real_value_traits>::value;
+
/// @cond
private:
tree_type tree_;
+
+ protected:
+ node &prot_header_node(){ return tree_.prot_header_node(); }
+ node const &prot_header_node() const{ return tree_.prot_header_node(); }
+ void prot_set_size(size_type s){ tree_.prot_set_size(s); }
+ value_compare &prot_comp(){ return tree_.prot_comp(); }
/// @endcond
public:
@@ -1450,7 +1469,7 @@
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: Constant.
+ //! <b>Complexity</b>: Logarithmic.
static multiset_impl &container_from_iterator(iterator it)
{
return *detail::parent_from_member<multiset_impl, tree_type>
@@ -1464,7 +1483,7 @@
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: Constant.
+ //! <b>Complexity</b>: Logarithmic.
static const multiset_impl &container_from_iterator(const_iterator it)
{
return *detail::parent_from_member<multiset_impl, tree_type>
Modified: sandbox/move/boost/intrusive/set_hook.hpp
==============================================================================
--- sandbox/move/boost/intrusive/set_hook.hpp (original)
+++ sandbox/move/boost/intrusive/set_hook.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -98,6 +98,7 @@
>::type
{
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
//!
@@ -224,6 +225,7 @@
>::type
{
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
//!
Modified: sandbox/move/boost/intrusive/sgtree.hpp
==============================================================================
--- sandbox/move/boost/intrusive/sgtree.hpp (original)
+++ sandbox/move/boost/intrusive/sgtree.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -310,7 +310,7 @@
{ return data_.node_plus_pred_.header_plus_alpha_.header_; }
static node_ptr uncast(const_node_ptr ptr)
- { return node_ptr(const_cast<node*>(detail::get_pointer(ptr))); }
+ { return node_ptr(const_cast<node*>(detail::boost_intrusive_get_pointer(ptr))); }
size_traits &priv_size_traits()
{ return data_.node_plus_pred_.size_traits_; }
@@ -1631,7 +1631,7 @@
static sgtree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
{
header_plus_alpha *r = detail::parent_from_member<header_plus_alpha, node>
- ( detail::get_pointer(end_iterator.pointed_node()), &header_plus_alpha::header_);
+ ( detail::boost_intrusive_get_pointer(end_iterator.pointed_node()), &header_plus_alpha::header_);
node_plus_pred_t *n = detail::parent_from_member
<node_plus_pred_t, header_plus_alpha>(r, &node_plus_pred_t::header_plus_alpha_);
data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_);
Modified: sandbox/move/boost/intrusive/sgtree_algorithms.hpp
==============================================================================
--- sandbox/move/boost/intrusive/sgtree_algorithms.hpp (original)
+++ sandbox/move/boost/intrusive/sgtree_algorithms.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -70,7 +70,7 @@
static node_ptr uncast(const_node_ptr ptr)
{
- return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer(ptr)));
+ return node_ptr(const_cast<node*>(::boost::intrusive::detail::boost_intrusive_get_pointer(ptr)));
}
/// @endcond
Modified: sandbox/move/boost/intrusive/slist.hpp
==============================================================================
--- sandbox/move/boost/intrusive/slist.hpp (original)
+++ sandbox/move/boost/intrusive/slist.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -31,6 +31,7 @@
#include <algorithm>
#include <cstddef> //std::size_t
#include <utility> //std::pair
+//iG pending #include <boost/pointer_cast.hpp>
namespace boost {
namespace intrusive {
@@ -129,10 +130,9 @@
typedef slist_iterator<slist_impl, true> const_iterator;
typedef typename real_value_traits::node_traits node_traits;
typedef typename node_traits::node node;
- typedef typename boost::pointer_to_other
- <pointer, node>::type node_ptr;
- typedef typename boost::pointer_to_other
- <pointer, const node>::type const_node_ptr;
+ typedef typename node_traits::node_ptr node_ptr;
+ typedef typename node_traits::const_node_ptr const_node_ptr;
+
typedef typename detail::if_c
< Config::linear
, linear_slist_algorithms<node_traits>
@@ -206,7 +206,8 @@
{ data_.root_plus_size_.last_ = n; }
static node_ptr uncast(const_node_ptr ptr)
- { return node_ptr(const_cast<node*>(detail::get_pointer(ptr))); }
+ { return node_ptr(const_cast<node*>(detail::boost_intrusive_get_pointer(ptr))); }
+//iG pending { return boost::const_pointer_cast<node>(ptr); }
void set_default_constructed_state()
{
@@ -251,6 +252,22 @@
real_value_traits &get_real_value_traits(detail::bool_<true>)
{ return data_.get_value_traits(*this); }
+ const value_traits &get_value_traits() const
+ { return data_; }
+
+ value_traits &get_value_traits()
+ { return data_; }
+
+ protected:
+ node &prot_root_node()
+ { return data_.root_plus_size_.root_; }
+
+ node const &prot_root_node() const
+ { return data_.root_plus_size_.root_; }
+
+ void prot_set_size(size_type s)
+ { data_.root_plus_size_.set_size(s); }
+
/// @endcond
public:
@@ -1220,7 +1237,7 @@
//! assigned to the last spliced element or prev if x is empty.
//! This iterator can be used as new "prev" iterator for a new splice_after call.
//! that will splice new values after the previously spliced values.
- void splice(const_iterator it, slist_impl &x, iterator *last = 0)
+ void splice(const_iterator it, slist_impl &x, const_iterator *last = 0)
{ this->splice_after(this->previous(it), x, last); }
//! <b>Requires</b>: it p must be a valid iterator of *this.
@@ -1295,8 +1312,9 @@
{
if (node_traits::get_next(node_traits::get_next(this->get_root_node()))
!= this->get_root_node()) {
- slist_impl carry;
- slist_impl counter[64];
+
+ slist_impl carry(this->get_value_traits());
+ detail::array_initializer<slist_impl, 64> counter(this->get_value_traits());
int fill = 0;
const_iterator last_inserted;
while(!this->empty()){
@@ -1879,7 +1897,7 @@
//singly linked lists (because "end" is represented by the null pointer)
BOOST_STATIC_ASSERT(!linear);
root_plus_size *r = detail::parent_from_member<root_plus_size, node>
- ( detail::get_pointer(end_iterator.pointed_node()), (&root_plus_size::root_));
+ ( detail::boost_intrusive_get_pointer(end_iterator.pointed_node()), (&root_plus_size::root_));
data_t *d = detail::parent_from_member<data_t, root_plus_size>
( r, &data_t::root_plus_size_);
slist_impl *s = detail::parent_from_member<slist_impl, data_t>(d, &slist_impl::data_);
Modified: sandbox/move/boost/intrusive/slist_hook.hpp
==============================================================================
--- sandbox/move/boost/intrusive/slist_hook.hpp (original)
+++ sandbox/move/boost/intrusive/slist_hook.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -96,6 +96,7 @@
>::type
{
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
//!
@@ -218,6 +219,7 @@
>::type
{
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
//!
Modified: sandbox/move/boost/intrusive/splay_set.hpp
==============================================================================
--- sandbox/move/boost/intrusive/splay_set.hpp (original)
+++ sandbox/move/boost/intrusive/splay_set.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -74,6 +74,8 @@
typedef typename implementation_defined::const_node_ptr const_node_ptr;
typedef typename implementation_defined::node_algorithms node_algorithms;
+ static const bool constant_time_size = Config::constant_time_size;
+
/// @cond
private:
tree_type tree_;
@@ -1286,6 +1288,8 @@
typedef typename implementation_defined::const_node_ptr const_node_ptr;
typedef typename implementation_defined::node_algorithms node_algorithms;
+ static const bool constant_time_size = Config::constant_time_size;
+
/// @cond
private:
tree_type tree_;
Modified: sandbox/move/boost/intrusive/splay_set_hook.hpp
==============================================================================
--- sandbox/move/boost/intrusive/splay_set_hook.hpp (original)
+++ sandbox/move/boost/intrusive/splay_set_hook.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -93,6 +93,7 @@
>::type
{
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
//!
@@ -216,6 +217,7 @@
>::type
{
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
//!
Modified: sandbox/move/boost/intrusive/splaytree.hpp
==============================================================================
--- sandbox/move/boost/intrusive/splaytree.hpp (original)
+++ sandbox/move/boost/intrusive/splaytree.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -166,7 +166,7 @@
static node_ptr uncast(const_node_ptr ptr)
{
- return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
+ return node_ptr(const_cast<node*>(detail::boost_intrusive_get_pointer(ptr)));
}
size_traits &priv_size_traits()
@@ -1405,7 +1405,7 @@
static splaytree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
{
header_plus_size *r = detail::parent_from_member<header_plus_size, node>
- ( detail::get_pointer(end_iterator.pointed_node()), &header_plus_size::header_);
+ ( detail::boost_intrusive_get_pointer(end_iterator.pointed_node()), &header_plus_size::header_);
node_plus_pred_t *n = detail::parent_from_member
<node_plus_pred_t, header_plus_size>(r, &node_plus_pred_t::header_plus_size_);
data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_);
Modified: sandbox/move/boost/intrusive/splaytree_algorithms.hpp
==============================================================================
--- sandbox/move/boost/intrusive/splaytree_algorithms.hpp (original)
+++ sandbox/move/boost/intrusive/splaytree_algorithms.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -147,7 +147,7 @@
private:
static node_ptr uncast(const_node_ptr ptr)
{
- return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer(ptr)));
+ return node_ptr(const_cast<node*>(::boost::intrusive::detail::boost_intrusive_get_pointer(ptr)));
}
/// @endcond
Modified: sandbox/move/boost/intrusive/treap.hpp
==============================================================================
--- sandbox/move/boost/intrusive/treap.hpp (original)
+++ sandbox/move/boost/intrusive/treap.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -116,7 +116,7 @@
<pointer, node>::type node_ptr;
typedef typename boost::pointer_to_other
<node_ptr, const node>::type const_node_ptr;
- typedef treap_algorithms<node_traits> node_algorithms;
+ typedef treap_algorithms<node_traits> node_algorithms;
static const bool constant_time_size = Config::constant_time_size;
static const bool stateful_value_traits = detail::is_stateful_value_traits<real_value_traits>::value;
@@ -184,7 +184,7 @@
static node_ptr uncast(const_node_ptr ptr)
{
- return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
+ return node_ptr(const_cast<node*>(detail::boost_intrusive_get_pointer(ptr)));
}
size_traits &priv_size_traits()
@@ -1482,7 +1482,7 @@
static treap_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
{
header_plus_size *r = detail::parent_from_member<header_plus_size, node>
- ( detail::get_pointer(end_iterator.pointed_node()), &header_plus_size::header_);
+ ( detail::boost_intrusive_get_pointer(end_iterator.pointed_node()), &header_plus_size::header_);
typename node_plus_pred_t::header_plus_priority_size *n =
detail::parent_from_member
< typename node_plus_pred_t::header_plus_priority_size
Modified: sandbox/move/boost/intrusive/treap_algorithms.hpp
==============================================================================
--- sandbox/move/boost/intrusive/treap_algorithms.hpp (original)
+++ sandbox/move/boost/intrusive/treap_algorithms.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -145,7 +145,7 @@
static node_ptr uncast(const_node_ptr ptr)
{
- return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer(ptr)));
+ return node_ptr(const_cast<node*>(::boost::intrusive::detail::boost_intrusive_get_pointer(ptr)));
}
/// @endcond
Modified: sandbox/move/boost/intrusive/treap_set.hpp
==============================================================================
--- sandbox/move/boost/intrusive/treap_set.hpp (original)
+++ sandbox/move/boost/intrusive/treap_set.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -75,6 +75,8 @@
typedef typename implementation_defined::const_node_ptr const_node_ptr;
typedef typename implementation_defined::node_algorithms node_algorithms;
+ static const bool constant_time_size = Config::constant_time_size;
+
/// @cond
private:
tree_type tree_;
@@ -1382,6 +1384,8 @@
typedef typename implementation_defined::const_node_ptr const_node_ptr;
typedef typename implementation_defined::node_algorithms node_algorithms;
+ static const bool constant_time_size = Config::constant_time_size;
+
/// @cond
private:
tree_type tree_;
Modified: sandbox/move/boost/intrusive/unordered_set.hpp
==============================================================================
--- sandbox/move/boost/intrusive/unordered_set.hpp (original)
+++ sandbox/move/boost/intrusive/unordered_set.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -248,7 +248,7 @@
//! <b>Effects</b>: Returns the number of elements stored in the unordered_set.
//!
//! <b>Complexity</b>: Linear to elements contained in *this if
- //! constant-time size option is enabled. Constant-time otherwise.
+ //! constant-time size option is disabled. Constant-time otherwise.
//!
//! <b>Throws</b>: Nothing.
size_type size() const
@@ -395,8 +395,8 @@
//!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased element. No destructors are called.
- iterator erase(const_iterator i)
- { return table_.erase(i); }
+ void erase(const_iterator i)
+ { table_.erase(i); }
//! <b>Effects</b>: Erases the range pointed to by b end e.
//!
@@ -407,8 +407,8 @@
//!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
- iterator erase(const_iterator b, const_iterator e)
- { return table_.erase(b, e); }
+ void erase(const_iterator b, const_iterator e)
+ { table_.erase(b, e); }
//! <b>Effects</b>: Erases all the elements with the given value.
//!
@@ -460,12 +460,12 @@
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
- iterator erase_and_dispose(const_iterator i, Disposer disposer
+ void erase_and_dispose(const_iterator i, Disposer disposer
/// @cond
, typename detail::enable_if_c<!detail::is_convertible<Disposer, const_iterator>::value >::type * = 0
/// @endcond
)
- { return table_.erase_and_dispose(i, disposer); }
+ { table_.erase_and_dispose(i, disposer); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
@@ -480,8 +480,8 @@
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
- iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
- { return table_.erase_and_dispose(b, e, disposer); }
+ void erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { table_.erase_and_dispose(b, e, disposer); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
@@ -1305,7 +1305,7 @@
//! <b>Effects</b>: Returns the number of elements stored in the unordered_multiset.
//!
//! <b>Complexity</b>: Linear to elements contained in *this if
- //! constant-time size option is enabled. Constant-time otherwise.
+ //! constant-time size option is disabled. Constant-time otherwise.
//!
//! <b>Throws</b>: Nothing.
size_type size() const
@@ -1387,8 +1387,8 @@
//!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased element. No destructors are called.
- iterator erase(const_iterator i)
- { return table_.erase(i); }
+ void erase(const_iterator i)
+ { table_.erase(i); }
//! <b>Effects</b>: Erases the range pointed to by b end e.
//!
@@ -1399,8 +1399,8 @@
//!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
- iterator erase(const_iterator b, const_iterator e)
- { return table_.erase(b, e); }
+ void erase(const_iterator b, const_iterator e)
+ { table_.erase(b, e); }
//! <b>Effects</b>: Erases all the elements with the given value.
//!
@@ -1453,17 +1453,17 @@
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
- iterator erase_and_dispose(const_iterator i, Disposer disposer
+ void erase_and_dispose(const_iterator i, Disposer disposer
/// @cond
, typename detail::enable_if_c<!detail::is_convertible<Disposer, const_iterator>::value >::type * = 0
/// @endcond
)
- { return table_.erase_and_dispose(i, disposer); }
+ { table_.erase_and_dispose(i, disposer); }
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
template<class Disposer>
- iterator erase_and_dispose(const_iterator i, Disposer disposer)
- { return this->erase_and_dispose(const_iterator(i), disposer); }
+ void erase_and_dispose(const_iterator i, Disposer disposer)
+ { this->erase_and_dispose(const_iterator(i), disposer); }
#endif
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
@@ -1479,8 +1479,8 @@
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
- iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
- { return table_.erase_and_dispose(b, e, disposer); }
+ void erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { table_.erase_and_dispose(b, e, disposer); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
Modified: sandbox/move/boost/intrusive/unordered_set_hook.hpp
==============================================================================
--- sandbox/move/boost/intrusive/unordered_set_hook.hpp (original)
+++ sandbox/move/boost/intrusive/unordered_set_hook.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -16,6 +16,7 @@
#include <boost/intrusive/detail/config_begin.hpp>
#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/pointer_cast.hpp>
#include <boost/intrusive/detail/utilities.hpp>
#include <boost/intrusive/detail/pointer_to_other.hpp>
#include <boost/intrusive/slist_hook.hpp>
@@ -76,7 +77,10 @@
static const bool optimize_multikey = OptimizeMultiKey;
static node_ptr get_next(const_node_ptr n)
- { return node_ptr(&static_cast<node &>(*n->next_)); }
+ {
+ using ::boost::static_pointer_cast;
+ return static_pointer_cast<node>(n->next_);
+ }
static void set_next(node_ptr n, node_ptr next)
{ n->next_ = next; }
@@ -222,6 +226,7 @@
>::type
{
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
//!
@@ -351,6 +356,7 @@
>::type
{
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
//!
Modified: sandbox/move/boost/move/move.hpp
==============================================================================
--- sandbox/move/boost/move/move.hpp (original)
+++ sandbox/move/boost/move/move.hpp 2010-04-25 08:26:48 EDT (Sun, 25 Apr 2010)
@@ -19,8 +19,8 @@
//! \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
@@ -28,12 +28,49 @@
#include <iterator> //std::iterator
#include <boost/mpl/if.hpp>
#include <boost/utility/enable_if.hpp>
+#include <boost/mpl/bool.hpp>
#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
+//#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 {
+INTERPROCESS_NAMESPACE_BEGIN
namespace move_detail {
template <class T>
@@ -54,15 +91,20 @@
enum { value = sizeof(dispatch(trigger())) == sizeof(true_t) };
};
-
} //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) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+
+#include <boost/type_traits/is_fundamental.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/type_traits/is_same.hpp>
namespace boost {
+INTERPROCESS_NAMESPACE_BEGIN
//////////////////////////////////////////////////////////////////////////////
//
@@ -106,22 +148,22 @@
//
//////////////////////////////////////////////////////////////////////////////
template<class T>
-class is_movable
+struct is_movable
+ : public ::boost::mpl::bool_<move_detail::is_convertible<T, rv<T>&>::value>
{
- public:
- static const bool value = 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>
{
- public:
- static const bool value = false;
};
template <class T>
-struct has_nothrow_move : is_movable<T>
-{};
+struct has_nothrow_move
+ : public ::boost::mpl::bool_<false>
+{
+};
//////////////////////////////////////////////////////////////////////////////
//
@@ -129,7 +171,7 @@
//
//////////////////////////////////////////////////////////////////////////////
template <class T>
-typename boost::disable_if<is_movable<T>, T&>::type move(T& x)
+typename ::boost::disable_if<is_movable<T>, T&>::type move(T& x)
{
return x;
}
@@ -146,6 +188,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()
@@ -153,58 +231,108 @@
//////////////////////////////////////////////////////////////////////////////
template <class T>
-typename enable_if<boost::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::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_RV_REF(TYPE)\
- boost::rv< TYPE >& \
-//
-
-#define BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
- boost::rv< TYPE<ARG1, ARG2> >& \
-//
-
-#define BOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
- boost::rv< TYPE<ARG1, ARG2, ARG3> >& \
-//
+#else //BOOST_MOVE_OPTIMIZED_EMULATION
#define BOOST_COPY_ASSIGN_REF(TYPE)\
- const boost::rv< TYPE >& \
-//
-
-#define BOOST_COPY_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
- const boost::rv< TYPE<ARG1, ARG2> >& \
+ const TYPE & \
//
-#define BOOST_COPY_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
- const boost::rv< TYPE<ARG1, ARG2, ARG3> >& \
+#define BOOST_MOVE_MACRO_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
+ const TYPE< ARG1, ARG2 >& \
//
-#define BOOST_FWD_REF(TYPE)\
- const TYPE & \
+#define BOOST_MOVE_MACRO_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
+ const TYPE< ARG1, ARG2, ARG3 > & \
//
//////////////////////////////////////////////////////////////////////////////
//
-// BOOST_ENABLE_MOVE_EMULATION
+// forward()
//
//////////////////////////////////////////////////////////////////////////////
-#define BOOST_ENABLE_MOVE_EMULATION(TYPE)\
- operator boost::rv<TYPE>&() \
- { return *reinterpret_cast<boost::rv<TYPE>* >(this); }\
- operator const boost::rv<TYPE>&() const \
- { return *reinterpret_cast<const boost::rv<TYPE>* >(this); }\
-//
+/*
+template <class T>
+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_MOVE_NAMESPACE::move_detail::is_rv<T>, const T &>::type
+ forward(const typename move_detail::identity<T>::type &x)
+{
+ return x;
+}
+*/
+
+//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);
+}
+
+//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);
+}
+
+//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);
+}
+
+//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);
+}
+
+//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;
+}
+
+//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; }
+
+#endif
//////////////////////////////////////////////////////////////////////////////
//
@@ -216,10 +344,10 @@
TYPE(TYPE &);\
TYPE& operator=(TYPE &);\
public:\
- operator boost::rv<TYPE>&() \
- { return *reinterpret_cast<boost::rv<TYPE>* >(this); }\
- operator const boost::rv<TYPE>&() const \
- { return *reinterpret_cast<const boost::rv<TYPE>* >(this); }\
+ operator ::BOOST_MOVE_NAMESPACE::rv<TYPE>&() \
+ { return *reinterpret_cast< ::BOOST_MOVE_NAMESPACE::rv<TYPE>* >(this); }\
+ operator const ::BOOST_MOVE_NAMESPACE::rv<TYPE>&() const \
+ { return *reinterpret_cast<const ::BOOST_MOVE_NAMESPACE::rv<TYPE>* >(this); }\
private:\
//
@@ -228,30 +356,59 @@
// BOOST_COPYABLE_AND_MOVABLE
//
//////////////////////////////////////////////////////////////////////////////
+
+#ifdef BOOST_MOVE_OPTIMIZED_EMULATION
+
#define BOOST_COPYABLE_AND_MOVABLE(TYPE)\
public:\
TYPE& operator=(TYPE &t)\
- { this->operator=(static_cast<const ::boost::rv<TYPE> &>(const_cast<const TYPE &>(t))); return *this;}\
+ { this->operator=(static_cast<const ::BOOST_MOVE_NAMESPACE::rv<TYPE> &>(const_cast<const TYPE &>(t))); return *this;}\
public:\
- operator ::boost::rv<TYPE>&() \
- { return *reinterpret_cast< ::boost::rv<TYPE>* >(this); }\
- operator const ::boost::rv<TYPE>&() const \
- { return *reinterpret_cast<const ::boost::rv<TYPE>* >(this); }\
+ operator ::BOOST_MOVE_NAMESPACE::rv<TYPE>&() \
+ { return *reinterpret_cast< ::BOOST_MOVE_NAMESPACE::rv<TYPE>* >(this); }\
+ operator const ::BOOST_MOVE_NAMESPACE::rv<TYPE>&() const \
+ { return *reinterpret_cast<const ::BOOST_MOVE_NAMESPACE::rv<TYPE>* >(this); }\
private:\
//
+#else //#ifdef BOOST_MOVE_OPTIMIZED_EMULATION
+
+#define BOOST_COPYABLE_AND_MOVABLE(TYPE)\
+ public:\
+ operator ::BOOST_MOVE_NAMESPACE::rv<TYPE>&() \
+ { return *reinterpret_cast< ::BOOST_MOVE_NAMESPACE::rv<TYPE>* >(this); }\
+ operator const ::BOOST_MOVE_NAMESPACE::rv<TYPE>&() const \
+ { return *reinterpret_cast<const ::BOOST_MOVE_NAMESPACE::rv<TYPE>* >(this); }\
+ private:\
+//
+
+#endif
+
+
+INTERPROCESS_NAMESPACE_END
} //namespace boost
-#else //BOOST_HAS_RVALUE_REFS
+#else //BOOST_NO_RVALUE_REFERENCES
#include <boost/type_traits/remove_reference.hpp>
namespace boost {
+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];};
@@ -276,21 +433,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::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>
{
- public:
-// static const bool value = move_detail::is_convertible<T&&, T>::value;
- static const bool value = 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>
{};
//////////////////////////////////////////////////////////////////////////////
@@ -302,15 +456,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::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(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ <= 5)
+
+//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
+
//////////////////////////////////////////////////////////////////////////////
//
@@ -327,16 +496,36 @@
//! For compilers with rvalue references this function provides perfect forwarding.
//!
//! Otherwise:
-//! * If input_reference binds to const boost::rv<T> & then it output_reference is
-//! boost::rev<T> &
+//! * 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(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ <= 5)
+
+//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
+
+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
//////////////////////////////////////////////////////////////////////////////
//
@@ -414,11 +603,21 @@
TYPE && \
//
+/// @cond
+
+#define BOOST_CATCH_CONST_RLVALUE(TYPE)\
+ const TYPE & \
+//
+
+/// @endcond
+
+INTERPROCESS_NAMESPACE_END
} //namespace boost {
-#endif //BOOST_HAS_RVALUE_REFS
+#endif //BOOST_NO_RVALUE_REFERENCES
namespace boost {
+INTERPROCESS_NAMESPACE_BEGIN
//////////////////////////////////////////////////////////////////////////////
//
@@ -437,15 +636,15 @@
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::is_movable<value_type>
- , boost::rv<value_type>&
+ typedef typename ::boost::mpl::if_
+ < ::BOOST_MOVE_NAMESPACE::is_movable<value_type>
+ , ::BOOST_MOVE_NAMESPACE::rv<value_type>&
, value_type & >::type reference;
#endif
- typedef typename std::iterator_traits<iterator_type>::pointer pointer;
+ typedef It pointer;
typedef typename std::iterator_traits<iterator_type>::difference_type difference_type;
typedef typename std::iterator_traits<iterator_type>::iterator_category iterator_category;
@@ -466,10 +665,10 @@
reference operator*() const
{
- #if defined(BOOST_HAS_RVALUE_REFS)
+ #if !defined(BOOST_NO_RVALUE_REFERENCES)
return *m_it;
#else
- return boost::move(*m_it);
+ return ::BOOST_MOVE_NAMESPACE::move(*m_it);
#endif
}
@@ -502,10 +701,10 @@
reference operator[](difference_type n) const
{
- #if defined(BOOST_HAS_RVALUE_REFS)
+ #if !defined(BOOST_NO_RVALUE_REFERENCES)
return m_it[n];
#else
- return boost::move(m_it[n]);
+ return ::BOOST_MOVE_NAMESPACE::move(m_it[n]);
#endif
}
@@ -543,14 +742,14 @@
template <class I>
struct is_move_iterator
+ : public ::boost::mpl::bool_<false>
{
- static const bool value = false;
};
template <class I>
-struct is_move_iterator< ::boost::move_iterator<I> >
+struct is_move_iterator< ::BOOST_MOVE_NAMESPACE::move_iterator<I> >
+ : public ::boost::mpl::bool_<true>
{
- static const bool value = true;
};
} //namespace move_detail {
@@ -588,7 +787,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::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; }
@@ -623,7 +822,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::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; }
@@ -659,7 +858,7 @@
move_insert_iterator& operator=(typename C::reference x)
{
- pos_ = container_m->insert(pos_, boost::move(x));
+ pos_ = container_m->insert(pos_, ::BOOST_MOVE_NAMESPACE::move(x));
++pos_;
return *this;
}
@@ -686,7 +885,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::move (*(first + n)).
+//! performs *(result + n) = ::boost::move (*(first + n)).
//!
//! <b>Effects</b>: result + (last - first).
//!
@@ -698,7 +897,7 @@
O move(I f, I l, O result)
{
while (f != l) {
- *result = boost::move(*f);
+ *result = ::BOOST_MOVE_NAMESPACE::move(*f);
++f; ++result;
}
return result;
@@ -713,7 +912,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::move(*(last - n)).
+//! performs *(result - n) = ::boost::move(*(last - n)).
//!
//! <b>Requires</b>: result shall not be in the range [first,last).
//!
@@ -726,7 +925,7 @@
{
while (f != l) {
--l; --result;
- *result = boost::move(*l);
+ *result = ::BOOST_MOVE_NAMESPACE::move(*l);
}
return result;
}
@@ -756,7 +955,7 @@
{
typedef typename std::iterator_traits<I>::value_type input_value_type;
while (f != l) {
- ::new(static_cast<void*>(&*r)) input_value_type(boost::move(*f));
+ ::new(static_cast<void*>(&*r)) input_value_type(BOOST_MOVE_NAMESPACE::move(*f));
++f; ++r;
}
return r;
@@ -787,7 +986,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::uninitialized_move(f, l, r);
+ return ::BOOST_MOVE_NAMESPACE::uninitialized_move(f, l, r);
}
template
@@ -807,7 +1006,7 @@
F uninitialized_copy_or_move(I f, I l, F r,
typename enable_if< move_detail::is_move_iterator<I> >::type* = 0)
{
- return boost::move_detail::uninitialized_move_move_iterator(f, l, r);
+ return ::BOOST_MOVE_NAMESPACE::move_detail::uninitialized_move_move_iterator(f, l, r);
}
/// @endcond
@@ -836,19 +1035,53 @@
return std::uninitialized_copy(f, l, r);
}
-//! If this traits yields to true
+//! If this trait yields to true
//! (<i>has_trivial_destructor_after_move <T>::value == true</i>)
-//! menas that after moved, there is no need to call T's destructor.
-//! This optimization is used to improve containers' performance.
+//! means that if T is used as argument of a move construction/assignment,
+//! there is no need to call T's destructor.
+//! This optimization tipically is used to improve containers' performance.
//!
-//! By default this trais is true if the type has trivial destructor,
+//! 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
- : public boost::has_trivial_destructor<T>
+ : public ::boost::has_trivial_destructor<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
+
+INTERPROCESS_NAMESPACE_END
} //namespace boost {
#endif //#ifndef BOOST_MOVE_HPP
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